home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / advbas34.arc / ADVBAS.DOC < prev    next >
Encoding:
Text File  |  1987-06-25  |  109.6 KB  |  5,225 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                 Advanced Function Library for the BASIC Compiler
  9.  
  10.  
  11.                             ADVBAS.LIB v3.4, 06/25/87
  12.  
  13.                    Copyright (C) Thomas Hanlin III, 1985-1987
  14.  
  15.  
  16.      NEW ADDRESS:
  17.        1712 Maple Hill Place
  18.        Alexandria, VA 22302
  19.  
  20.  
  21.  
  22.  
  23.      Requirements:
  24.  
  25.           A  PC-compatible  computer  with  DOS  version  2.0 or higher, and
  26.      either Microsoft QuickBASIC or the IBM BASIC Compiler.
  27.  
  28.           IMPORTANT: Please read the Operation Notes!
  29.  
  30.  
  31.  
  32.      Copying and Distribution:
  33.  
  34.           ADVBAS  may  be  copied  and  distributed  freely  EXCEPT  FOR THE
  35.      ASSEMBLY  SOURCE  CODE.   If  you  distribute  ADVBAS on communications
  36.      systems  such  as  BBSes  or  CompuServe,  the  Source, et al, you must
  37.      include  a  minimum  of  the following unmodified files as a set (using
  38.      ARC   or  an  equivalent  archive  utility):   ADVBAS.EXE,  ADVBAS.LIB,
  39.      ADVBAS.DOC,  ADVBAS.NEW,  ADVBAS.QRF,  ADVBAS.ERR, CONTRIB.DOC.  No fee
  40.      other than a disk and handling charge (of up to $10) may be charged.
  41.  
  42.           The  copyright  is to preserve my options, and to protect you from
  43.      the  untoward  modifications  of others.  It is not intended to prevent
  44.      the public distribution of ADVBAS, subject to the above limitations.
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.      Introduction:
  75.  
  76.           The  BASIC  Compiler  is  a  powerful and flexible tool.  However,
  77.      it  suffers  from  a  number of limitations.  It is hard to access many
  78.      of  the  capabilities of DOS; any feature which requires error trapping
  79.      cannot  be  used  in  a  subprogram; the memory requirements are fairly
  80.      substantial;  and  the  speed  is not all that it might be, for all its
  81.      improvement  over  interpreted  BASIC.   To reduce these problems, I've
  82.      designed  a  number of assembly language routines which perform various
  83.      functions,  and  put  them  in a library which the compiler can access.
  84.      Since  I  have  found  these functions to be useful, I thought I'd pass
  85.      them  on  to other people.  You may use ADVBAS functions in any of your
  86.      programs.   I'd appreciate it if you acknowledged use of these routines
  87.      in your program or documentation.
  88.  
  89.           If  you  use  ADVBAS,  please  support it by becoming a registered
  90.      user.   For $25, you will get ADVBAS v3.4 on disk, complete with source
  91.      and  object  code.   If  you  have registered for a previous version of
  92.      ADVBAS, you can upgrade to v3.4 for only $10.
  93.  
  94.           This  is  the  final  release  of  ADVBAS.  Its successor, ProBas,
  95.      will  be  released  commercially  by  August  1987.  ProBas is a vastly
  96.      upgraded  and  extensively  documented  version  of  ADVBAS, containing
  97.      support  for  dynamic  arrays  and  expanded memory, an improved pop-up
  98.      window  manager,  sorting  in memory, virtual screen handling, and much
  99.      more!   If  you  like  ADVBAS,  you'll  love ProBas.  For further info,
  100.      please  call  HCSI  at  (301) 953-2191, from 9am - 6pm Eastern Standard
  101.      Time.
  102.  
  103.  
  104.  
  105.      Support:
  106.  
  107.           If  you  are  a  contributor  (bless you!), I'll certainly be glad
  108.      to  help  you  with  any  difficulties you may encounter.  U.S. Mail is
  109.      the  preferred  method  of  exchange,  but  feel  free  to  call if the
  110.      situation gets out of hand.
  111.  
  112.           If  you  are  not  a  contributor  (sigh), please send a SASE, and
  113.      I'll  get  back to you.  PLEASE do not phone!  If you don't care enough
  114.      to  contribute  the minimal fee I ask, you should not expect me to pro-
  115.      vide services.  TANSTAAFL!  (There Ain't No Such Thing As A Free Lunch)
  116.  
  117.  
  118.  
  119.      Caveats:
  120.  
  121.           These  functions  have  not  caused  me  any problems, and seem to
  122.      be  fully debugged.  However, I will not be responsible for any damages
  123.      caused by use, misuse, or inability to use ADVBAS.
  124.  
  125.           If  you  run into problems, please read the Operation Notes.  Most
  126.      calls I get are for information which is given clearly in the manual.
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.      Using ADVBAS with QuickBASIC (v2.0 or higher):
  141.  
  142.           If  you  use  QuickBASIC  in  the new programming environment, you
  143.      need  to  have  a  copy  of  ADVBAS.EXE in the drive/subdirectory where
  144.      you  keep  your  library  files  (like  BRUN20.LIB).  When you start up
  145.      QuickBASIC,  you  need  to  tell  it  to load the ADVBAS library so you
  146.      can  use  its  features.  Run QuickBASIC with the following syntax: "QB
  147.      /L  ADVBAS.EXE".   Alternately,  you  can specify a program filename as
  148.      well: "QB  PROGRAM.BAS  /L  ADVBAS.EXE".   You can leave off the ".BAS"
  149.      extension  to  the  program,  but  you can't leave the ".EXE" extension
  150.      off  ADVBAS.EXE.   Note  that  you are not meant to type in the quotes,
  151.      which  are  there  for  guidance  only.  You may also need to include a
  152.      drive/path  spec  for  ADVBAS  if  it is in a different drive/path than
  153.      the default.  That might look something like "QB /L B:ADVBAS.EXE".
  154.  
  155.  
  156.  
  157.      Using IBM or Microsoft BASIC compilers (command-line mode):
  158.  
  159.           Copy  ADVBAS.LIB to the disk on which you keep your BASIC Compiler
  160.      library files.  For programs which use ADVBAS functions, specify ADVBAS
  161.      when  LINK  asks  you  which  libraries to use.  That is, at the LINKer
  162.      prompt  "Libraries  [.LIB]:"  you  should  say  "ADVBAS"  (without  the
  163.      quotes!).   You  may  need to provide a drive/path spec if your program
  164.      is  not  in  the  same area that ADVBAS is, and if you don't have a SET
  165.      LIB  in  your  autoexec  file to tell the compiler where the library is
  166.      (only newer versions of the compilers have this feature). 
  167.  
  168.  
  169.  
  170.      Other languages:
  171.  
  172.           A  library  for  Microsoft  C is available under the name of ADVC.
  173.      It  is  in  C  source  format, so you can convert any nonstandard func-
  174.      tions  to  your  own  variety of C.  You can get a copy of ADVC on disk
  175.      from me for $15.  Updates are not anticipated in the near future.
  176.  
  177.  
  178.  
  179.      Advantages of ADVBAS:
  180.  
  181.           1) Adds abilities which are not otherwise available.
  182.           2) Is faster than the corresponding Compiled BASIC code.
  183.           3) Usually takes up less space in the resulting EXEcutable file.
  184.           4) Often leaves more free programming space.
  185.           5) Provides a useful library of tested low-level routines.
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.                                  Operation Notes
  207.  
  208.  
  209.  
  210.  
  211.      Function Requirements:
  212.  
  213.           Numeric  variables  used in function calls must be integers unless
  214.      specified  otherwise.   Either declare them using DEFINT, or add a per-
  215.      cent sign "%" to the end of the variable name.
  216.  
  217.           Strings  must  sometimes  be  defined to a certain minimum length,
  218.      due  to  limitations  on  what  assembly  language routines are allowed
  219.      to do to strings. 
  220.  
  221.           Dynamic Arrays cannot be used interchangeably with normal (Static)
  222.      arrays.   Use  only  static arrays with functions which require arrays,
  223.      unless  specifically  stated otherwise.  ProBas, the commercial version
  224.      of  ADVBAS,  contains  many  routines for handling dynamic arrays.  See
  225.      the Introduction for information on ProBas.
  226.  
  227.  
  228.  
  229.      Compatibility:
  230.  
  231.           These  functions  vary in what they demand of your PC.  Some func-
  232.      tions  will  work only on IBM PCs or clones, some will work on compati-
  233.      bles,  and  some  will  work  on any MS-DOS machine.  The compatibility
  234.      level  of each function is now listed, using the categories CLONE (will
  235.      work  on  hardware  compatibles  only),  BIOS  (close compatibles), DOS
  236.      (any  MS-DOS  machine), and ANY (hardware independent).  Be warned that
  237.      the  BASIC  Compiler  itself  does  not produce particularly compatible
  238.      code (BASIC video routines seem to be BIOS-compatible, etc).
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.                                 Routine Reference
  273.  
  274.  
  275.  
  276.  
  277.      Disk:
  278.           CopyFile:  copy a file
  279.           DelFile:  delete a file
  280.           DelSub, GetSub, MakeSub, SetSub:  subdirectory handling
  281.           DiskStat:  assorted disk status information
  282.           DrvSpace:  space left on a given drive
  283.           Exist:  see if a file exists
  284.           Fclose, Fcreate, Fopen, Fread, FsetEnd, FsetRec, Fclose:
  285.              file i/o
  286.           FindFirstF, FindNextF:  handle file(s) with wildcards
  287.           GetDrv, SetDrv:  get/set the default drive
  288.           GetFdate, GetFtime, SetFTD, GetFattr, SetFattr:  file info control
  289.           GetNameF, GetDateF, GetTimeF, GetAttrF, GetSizeF: file dir control
  290.           Mload:  a BLOAD routine
  291.           Rename:  rename a file
  292.           SubExist:  see if a subdirectory exists
  293.  
  294.      Input:
  295.           ClrKbd:  clear the keyboard buffer of pending keys
  296.           DosInkey:  get a key using DOS standard input
  297.           GetKbd, SetKbd:  get/set the status of the keyboard toggles
  298.           GetKey:  get one of a list of valid keys
  299.           KeyPress:  see if a key has been pressed
  300.  
  301.           MMcursorOn, MMcursorOff:         mouse cursor control
  302.           MMgetloc, MMsetloc, MMsetrange:  mouse display control
  303.           MMbutton, MMcheck, MMclick:      mouse status info
  304.  
  305.      String:
  306.           Bsq, BusqLen, Busq:  text compression/decompression
  307.           Checksum, CRC:  error checking (for telecomm and other uses)
  308.           Crunch:  remove duplicates of a character from a string.
  309.           DateN2S, DateS2N:  convert the date (numbers <--> string)
  310.           Extract:  take delimited substrings from a string using an index
  311.           Locase, Upcase:  case conversion
  312.           MultiAnd, MultiOr, MultiXor:  bit manipulations on strings
  313.           Strip, StripBlanks, StripRange:  deletion of chars from a string
  314.           LRotate, RRotate, Reverse:  reorder chars in a string
  315.           Soundex:  return the Soundex code of a string
  316.           TimeN2S, TimeS2N:  convert the time (numbers <--> string)
  317.           Tinstr:  find a given type of char within a string
  318.           Xlate:  run the chars of a string through a translation table
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.                                 Routine Reference
  339.  
  340.  
  341.  
  342.  
  343.      Array:
  344.           AddMatI, SetMatI:  integer array manipulation
  345.           DynPtr:  allows use of dynamic arrays with specific routines
  346.           ReadBitF, WriteBitF:  handle arrays of arbitrary bit length
  347.  
  348.      Video:
  349.           CalcAttr:  calculate attribute from fore and background colors
  350.           ClrEol, BkSpace, DelChr, InsChr, MDelChr, MInsChr:  screen control
  351.           DGetScreen, DPutScreen: screen save/restore using dynamic arrays
  352.           DMprint, Mprint, MprintC, Qprint, XQprint:  various print routines
  353.           GetCRT:  get display type (mono or color)
  354.           GetEGA:  get display type (EGA or not)
  355.           MakeWindow:  make pop-up windows
  356.           Mwindow, Scroll, BkScroll:  display window control
  357.           PrintScreen:  print out the display to the default printer
  358.           ScrSave, ScrRest, GetLine:  save/restore the contents of a screen
  359.           ScrSaveP, ScrSavePD, ScrRestP, ScrRestPD:  variants on the above
  360.           GetScreen, PutScreen:  new flexible screen save/restore routines
  361.           ReColor: change any screen color to another w/o clearing screen
  362.           ResetPoint, SetPoint, TestPoint:  low-res graphics in text mode
  363.  
  364.      Miscellaneous:
  365.           Any2Dec, Dec2Any:  radix conversion (decimal <--> another base)
  366.           BlockMove:  move data from one area of memory to another
  367.           Carrier:  check modem Carrier Detect signal
  368.           DataSeg:  return the value of the default Data Segment
  369.           Date2int, Int2date:  date compression
  370.           Delay, Delay18th:  delay for a given amount of time
  371.           DTR:  turn the communications line "DTR" on or off
  372.           Equipment:  get hardware info about memory and installed ports
  373.           GetDOSv:  get the version number of the MS-DOS being used
  374.           GetExtM:  return the amount of extended memory (AT systems only)
  375.           GetLIMM:  get the status of expanded memory in the system
  376.           Month:  given a month number, returns the name of the month
  377.           SetComm:  set up any comm port to any baud, without closing comm
  378.           ShiftL, ShiftR:  bit shifts for integers
  379.           Speaker:  turns sound effects on or off
  380.           Time2int, Int2time:  time compression
  381.           WeekDay:  returns the day of the week, Sunday through Saturday
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.                                Compatibility Chart
  405.  
  406.  
  407.  
  408.  
  409.      Works on ANY machine:
  410.  
  411.           ADDMATI,   ANY2DEC,   BLOCKMOVE,  BSQ,  BUSQ,  BUSQLEN,  CALCATTR,
  412.      CHECKSUM,  CRC,  CRUNCH,  DATASEG,  DATE2INT, DEC2ANY, DYNPTR, EXTRACT,
  413.      GETLINE, INT2DATE, INT2TIME, LOCASE, LROTATE, MONTH, MULTIAND, MULTIOR,
  414.      MULTIXOR, READBITF, REVERSE, RROTATE, SETMATI, SHIFTL, SHIFTR, SOUNDEX,
  415.      STRIP,  STRIPBLANKS,  STRIPRANGE,  TIME2INT, TINSTR, UPCASE, WRITEBITF,
  416.      XLATE
  417.  
  418.  
  419.  
  420.      Works on DOS compatibles:
  421.  
  422.           COPYFILE,  DELFILE, DELSUB, DISKSTAT, DMPRINT, DOSINKEY, DRVSPACE,
  423.      EXIST,  FCLOSE,  FCREATE, FINDFIRSTF, FINDNEXTF, FOPEN, FREAD, FSETEND,
  424.      FSETREC,   FWRITE,   GETATTRF,  GETDATEF,  GETDOSV,  GETDRV,  GETFATTR,
  425.      GETFDATE,  GETFTIME,  GETNAMEF,  GETSIZEF,  GETSUB,  GETTIMEF, MAKESUB,
  426.      MLOAD, RENAME, SETDRV, SETFATTR, SETFTD, SETSUB, SUBEXIST, WEEKDAY
  427.  
  428.  
  429.  
  430.      Works on BIOS compatibles (* if it requires the AT BIOS):
  431.  
  432.           BKSCROLL,  BKSPACE,  CARRIER,  CLRKBD,  CLREOL,  DATEN2S, DATES2N,
  433.      DELAY, DELAY18TH, EQUIPMENT, GETCRT, GETEGA, GETEXTM*, GETKEY, GETLIMM,
  434.      KEYPRESS,  MDELCHR,  MINSCHR,  MMBUTTON, MMCHECK, MMCLICK, MMCURSOROFF,
  435.      MMCURSORON,  MMGETLOC,  MMSETLOC, MMSETRANGE, MPRINT, MPRINTC, MWINDOW,
  436.      PRINTSCREEN, RESETPOINT, SETPOINT, SCROLL, TESTPOINT, TIMEN2S, TIMES2N,
  437.      XMPRINT
  438.  
  439.  
  440.  
  441.      Works on CLONEs (hardware compatibles):
  442.  
  443.           DELCHR,  DGETSCREEN,  DPUTSCREEN,  DTR, GETKBD, GETSCREEN, INSCHR,
  444.      MAKEWINDOW,  PUTSCREEN,  QPRINT, RECOLOR, SCRREST, SCRRESTP, SCRRESTPD,
  445.      SCRSAVE,   SCRSAVEP,  SCRSAVEPD,  SETCOMM,  SETKBD,  SPEAKER,  XQPRINT,
  446.      XQPRINTD
  447.  
  448.  
  449.  
  450.           Note  that  routines  from  higher  sections will work on machines
  451.      from  lower  sections  (DOS-level  routines  will  work  on  BIOS-  and
  452.      CLONE-level   machines).    It   doesn't  work  the  other  way  around
  453.      (CLONE-level routines may not work on a DOS-level machine).
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.      Name: ADDMATI
  471.  
  472.      Type: Miscellaneous / ANY
  473.  
  474.      Description:
  475.           Adds a scalar (integer) value to the first SIZ elements of an
  476.      integer  array.   You  can  subtract  by  adding a negative number.  If
  477.      the  results  of  the calculation ever go outside integer range (-32768
  478.      to 32767), the
  479.      overflow flag is set on return.  See SETMATI for more information.
  480.  
  481.      Example:
  482.           OPTION BASE 1: DIM ACK%(10000): SIZ%=10000
  483.            .
  484.            .
  485.           ADDVAL%=-6: ARLOC%=VARPTR(ACK%(1))
  486.           CALL ADDMATI(ARLOC%,SIZ%,ADDVAL%,OVFLOW%)
  487.           IF OVFLOW% THEN PRINT"Uh oh, overflowed somewhere..."
  488.           REM  we just subtracted six from each element of the array ACK.
  489.  
  490.  
  491.  
  492.  
  493.      Name: ANY2DEC
  494.  
  495.      Type: Miscellaneous / ANY
  496.  
  497.      Description:
  498.           Converts  a  number  (in  string  form)  from any base (2-35) to a
  499.      decimal integer (base 10).  The number to be converted may be in either
  500.      signed  integer  range  (-32768  to 32767) or unsigned integer range (0
  501.      to  65535).   It  is  converted  to a signed integer, which is the only
  502.      integer type BASIC supports.
  503.  
  504.      Example:
  505.           INPUT"Number, base of number";ANUM$,NBASE%
  506.           CALL ANY2DEC(ANUM$,NBASE%,DNUM%,ERCD%)
  507.           IF ERCD% THEN PRINT"Bad number!" ELSE PRINT"Decimal: ";DNUM%
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.      Name: BKSCROLL
  537.  
  538.      Type: Video / BIOS
  539.  
  540.      Description:
  541.           The  same  as  SCROLL  (q.v.),  but  scrolls lines in the opposite
  542.      direction (Back Scroll).
  543.  
  544.      Example:
  545.        
  546.           CALL BKSCROLL(LEFTCOL%,TOPROW%,RTCOL%,BOTROW%,NUMLINES%)
  547.  
  548.  
  549.  
  550.  
  551.      Name: BKSPACE
  552.  
  553.      Type: Video / BIOS
  554.  
  555.      Description:
  556.           Move  cursor back one space, destroying the character on the space
  557.      moved  to.   Will  wrap  from one line to the next higher if necessary.
  558.      If  at  the  top  left  corner  of  the screen, no action is performed.
  559.      Two  arguments  return  the  new  cursor coordinates.  Works with 40 or
  560.      80 column screens in text mode.
  561.  
  562.      Example:
  563.           CALL BKSPACE(COL%,ROW%): LOCATE ROW%,COL%
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.      Name: BLOCKMOVE
  604.  
  605.      Type: Miscellaneous / ANY
  606.  
  607.      Description:
  608.           Copies information from one area of memory to another.  You supply
  609.      the  source  segment and offset, destination segment and offset, number
  610.      of  bytes  to  move (0 - 65535), and direction (zero, forward; nonzero,
  611.      backward).   This  can  be  used,  for  instance,  to duplicate arrays,
  612.      including  dynamic  arrays.   For such purposes, use the DYNPTR routine
  613.      to get the location of the array.
  614.  
  615.      Example:
  616.      CALL BLOCKMOVE(FROMSEG%,FROMOFFSET%,TOSEG%,TOOFFSET%,BYTES%,DIRECTION%)
  617.  
  618.  
  619.  
  620.  
  621.      Name: BSQ
  622.  
  623.      Type: String / ANY
  624.  
  625.      Description:
  626.           Uses  several  techniques to compress blank spaces out of an ASCII
  627.      string.   Savings  range  from  16% (reliable, for ordinary text) to up
  628.      around 50% or more for space-intensive info, such as lines in an assem-
  629.      bly  source  file.   BSQ  cannot  handle  more than 127 spaces in a row
  630.      on  a  single  line,  or  lines  which contain ASCII characters greater
  631.      than  127  (which  are  IBM-specific  graphics characters).  Do not use
  632.      BSQ  on  lines  which  may  contain  such information!  BSQ compression
  633.      is  designed  to  produce printable (if odd-looking) text which you may
  634.      read/write to ordinary sequential files.
  635.  
  636.      Example:
  637.           INPUT"String to squeeze";ST$: CALL BSQ(ST$,SLEN%)
  638.           PRINT"Squeezed string: ";LEFT$(ST$,SLEN%)
  639.  
  640.  
  641.  
  642.  
  643.      Name: BUSQ
  644.  
  645.      Type: String / ANY
  646.  
  647.      Description:
  648.           Decompresses  a  line  squeezed  by  BSQ.  Use BUSQLEN before this
  649.      routine to find out how long the unsqueezed line will be!
  650.  
  651.      Example:
  652.           see BUSQLEN
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.      Name: BUSQLEN
  670.  
  671.      Type: String / ANY
  672.  
  673.      Description:
  674.           Tells  how  long  a  line  squeezed  with  BSQ  will  be once it's
  675.      unsqueezed.  You must use this before unsqueezing the line with BUSQ.
  676.  
  677.      Example:
  678.           CALL BUSQLEN(ST$,SLEN%)
  679.           IF SLEN%<0 THEN line not squeezed, or damaged-- exit!
  680.           ELSE UNSQ$=SPACE$(SLEN%): CALL BUSQ(ST$,UNSQ$)
  681.  
  682.  
  683.  
  684.  
  685.      Name: CALCATTR
  686.  
  687.      Type: Video / ANY
  688.  
  689.      Description:
  690.           Calculates  the  color  attribute  for  such  routines as XQPRINT.
  691.      Unlike  the  BASIC  formula  it  replaces,  CALCATTR  allows use of the
  692.      "blink" attribute.
  693.  
  694.      Example:
  695.           REM  old formula was  ATTR% = (BACKGND% AND 7)*16 + FOREGND%
  696.           CALL CALCATTR(FOREGND%,BACKGND%,ATTR%)
  697.  
  698.  
  699.  
  700.  
  701.      Name: CARRIER
  702.  
  703.      Type: Miscellaneous / BIOS
  704.  
  705.      Description:
  706.           Returns  the  status  of the modem Carrier Detect signal.  You may
  707.      specify communications port one or two.
  708.  
  709.      Example:
  710.           COMMPORT% = 1
  711.           CALL CARRIER(COMMPORT%,CDSTATUS%)
  712.           IF CDSTATUS% THEN PRINT "Carrier detected" ELSE PRINT "No carrier"
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.      Name: COPYFILE
  736.  
  737.      Type: Disk / DOS
  738.  
  739.      Description:
  740.           Copies a file.  This is faster than the corresponding DOS command,
  741.      and  doesn't  have  the  overhead of using the SHELL command.  Note: to
  742.      avoid  possibly  wiping  out  an  existing file on the destination end,
  743.      you may wish to use the EXIST function before this one.
  744.           The  copy  will  usually  fail  for one of two reasons: the source
  745.      file  doesn't  exist,  or  there is not enough room on the disk for the
  746.      destination file.
  747.  
  748.      Example:
  749.           SOURCE$="A:EXAMPLE.TXT"+CHR$(0)
  750.           DESTINATION$="C:\DOCUMENT\EXAMPLE.TXT"+CHR$(0)
  751.           CALL COPYFILE(SOURCE$,DESTINATION$,ERRCODE%)
  752.           IF ERRCODE% THEN PRINT"The copy failed"
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.      Name: CHECKSUM
  802.  
  803.      Type: Miscellaneous / ANY
  804.  
  805.      Description:
  806.           Calculates  a  checksum  for  a  record.   Can be used with Xmodem
  807.      or Ymodem.
  808.  
  809.      Example:
  810.           CALL CHECKSUM(REC$,CHKSM%)
  811.  
  812.  
  813.  
  814.  
  815.      Name: CLREOL
  816.  
  817.      Type: Video / BIOS
  818.  
  819.      Description:
  820.           Clears  from  the  cursor  position to the end of the line without
  821.      moving the cursor.
  822.  
  823.      Example:
  824.           CALL CLREOL
  825.  
  826.  
  827.  
  828.  
  829.      Name: CLRKBD
  830.  
  831.      Type: Input / BIOS
  832.  
  833.      Description:
  834.           Clears any pending keys from the keyboard buffer.
  835.  
  836.      Example:
  837.           CALL CLRKBD
  838.           INPUT"File not found.  Continue (Y/N)";ANS$
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.      Name: CRC
  868.  
  869.      Type: Miscellaneous / ANY
  870.  
  871.      Description:
  872.           Calculates  a  cyclical redundancy check value for a record.  This
  873.      is  useful  for  error  detection,  and  can be used with Xmodem CRC or
  874.      Ymodem CRC modem transfer protocols.
  875.  
  876.      Example:
  877.        Sending a record:
  878.           REC$=REC$+STRING$(2,0) : CALL CRC(REC$,HICRC%,LOCRC%) :
  879.           MID$(REC$,LEN(REC$)-1,2) = CHR$(HICRC)+CHR$(LOCRC%)
  880.           REM  we're set to send an Xmodem record
  881.        Receiving a record:
  882.           CALL CRC(REC$,HICRC%,LOCRC%) : IF HICRC%=0 AND LOCRC%=0
  883.                THEN record is fine, save it
  884.                ELSE record is bad, request it to be sent again
  885.  
  886.  
  887.  
  888.  
  889.      Name: CRUNCH
  890.  
  891.      Type: String / ANY
  892.  
  893.      Description:
  894.           Crunches  duplicates  of  a  given  character  in a string down to
  895.      a single character.
  896.  
  897.      Example:
  898.           ST$="This####is#a##test"
  899.           CH$="#"
  900.           CALL CRUNCH(ST$,CH$,SLEN%)
  901.           ST$=LEFT$(ST$,SLEN%)
  902.           REM  the result here will be "This#is#a#test"
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.      Name: DATASEG
  934.  
  935.      Type: Miscellaneous / ANY
  936.  
  937.      Description:
  938.           Returns  BASIC's  data  segment.   This  is  useful for BLOCKMOVE,
  939.      among other things.
  940.  
  941.      Example:
  942.           CALL DATASEG(DSEG%)
  943.  
  944.  
  945.  
  946.  
  947.      Name: DATE2INT
  948.  
  949.      Type: Miscellaneous / ANY
  950.  
  951.      Description:
  952.           Compresses  a  date  down  to  a single integer, to reduce storage
  953.      requirements.   The  date  is  assumed to be valid.  The year should be
  954.      within  the  range  1900-2026  (0-99  is  ok,  and  is  assumed  to  be
  955.      1900-1999).  See also INT2DATE.
  956.  
  957.      Example:
  958.           CALL DATE2INT(MONTH%,DAY%,YEAR%,SQZDATE%)
  959.  
  960.  
  961.  
  962.  
  963.      Name: DATEN2S
  964.  
  965.      Type: String / ANY
  966.  
  967.      Description:
  968.           Converts the date from numeric form to a string.  You must reserve
  969.      at least eight characters for the string.
  970.  
  971.      Example:
  972.           MONTH% = 3: DAY% = 2: YEAR% = 1987
  973.           REM  We could use YEAR%=87 instead
  974.           DAT$ = SPACE$(8)
  975.           CALL DATEN2S(MONTH%,DAY%,YEAR%,DAT$)
  976.           REM  From this, we will get DAT$ = "03/02/87"
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.      Name: DATES2N
  1000.  
  1001.      Type: String / ANY
  1002.  
  1003.      Description:
  1004.           Converts  the date from a string to numeric form.  The date string
  1005.      may   be  in  either  BASIC  format  ("03-15-1987")  or  normal  format
  1006.      ("03/15/87").
  1007.  
  1008.      Example:
  1009.           CALL DATES2N(MONTH%,DAY%,YEAR%,DATE$)
  1010.  
  1011.  
  1012.  
  1013.  
  1014.      Name: DEC2ANY
  1015.  
  1016.      Type: Miscellaneous / ANY
  1017.  
  1018.      Description:
  1019.           Converts  a  number  from  decimal  (base  10)  to  any other base
  1020.      (2-35).   The  number  will be converted to an unsigned integer (signed
  1021.      range of -32768 to 32767 is converted to unsigned range of 0 to 65535),
  1022.      to  conform with the built-in BASIC conversion functions HEX$ and OCT$.
  1023.      ANUM$  must be initialized to the maximum size you expect the resultant
  1024.      number  to  be;  this  is recommended to be 16 characters, which is the
  1025.      maximum  length  possible.   The result is right-justified in the field
  1026.      you  provide,  so  if  you want to keep leading zeroes, just ignore the
  1027.      actual-length specification ALEN%.
  1028.  
  1029.      Example:
  1030.           INPUT"Decimal number, to base";DNUM%,NBASE%
  1031.           ANUM$ = STRING$(16,"0"): CALL DEC2ANY(DNUM%,NBASE%,ANUM$,ALEN%)
  1032.           IF ALEN%<0 THEN PRINT"Bad base or ANUM$ initialized too short"
  1033.           ELSE PRINT"Result: ";RIGHT$(ANUM$,ALEN%)
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.      Name: DELAY
  1066.  
  1067.      Type: Miscellaneous / BIOS
  1068.  
  1069.      Description:
  1070.           Delays for a given number of seconds.  This is based on the system
  1071.      clock,  and  will  delay  for  the  same  amount  of time on an 8088 or
  1072.      80286-based  computer.   It  is  normally  accurate to within about one
  1073.      percent.
  1074.  
  1075.      Example:
  1076.           SECONDS%=60
  1077.           CALL DELAY(SECONDS%)
  1078.           REM  sit and "do nothing" for one minute
  1079.  
  1080.  
  1081.  
  1082.  
  1083.      Name: DELAY18TH
  1084.  
  1085.      Type: Miscellaneous / BIOS
  1086.  
  1087.      Description:
  1088.           Delays  for  a given number of eighteenths of seconds.  Otherwise,
  1089.      this is identical to DELAY (see).
  1090.  
  1091.      Example:
  1092.           MINIDELAY%=9
  1093.           CALL DELAY18TH(MINIDELAY%)
  1094.           REM  delay for half a second (9/18 = 1/2 second)
  1095.  
  1096.  
  1097.  
  1098.  
  1099.      Name: DELCHR
  1100.  
  1101.      Type: Video / CLONE
  1102.  
  1103.      Description:
  1104.           Deletes  a  character  from  the specified location on the screen.
  1105.      The  character  at  that  location  will  disappear, and all characters
  1106.      to  the  right  of  it on the same screen line will be shifted left one
  1107.      space.   The  first  page  only  (on  color monitors) is supported, and
  1108.      text mode is required.
  1109.  
  1110.      Example:
  1111.           COL%=POS(0): ROW%=CSRLIN
  1112.           CALL DELCHR(ROW%,COL%)
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.      Name: DELFILE
  1132.  
  1133.      Type: Disk / DOS
  1134.  
  1135.      Description:
  1136.           Deletes  a  file.   Wildcards  are  not  allowed.  This returns an
  1137.      error  code,  and  can  be  used  in subprograms since it won't trigger
  1138.      BASIC's  error  trapping.  Errors may occur if you specify a file which
  1139.      doesn't exist, or which is protected by the read-only attribute.
  1140.  
  1141.      Example:
  1142.           FIL$="TEST.FOO"+CHR$(0)
  1143.           CALL DELFILE(FIL$,ERRCODE%)
  1144.           IF ERRCODE% THEN couldn't delete it ELSE file deleted
  1145.  
  1146.  
  1147.  
  1148.  
  1149.      Name: DELSUB
  1150.  
  1151.      Type: Disk / DOS
  1152.  
  1153.      Description:
  1154.           Deletes  a  subdirectory.   Parameters  used  are  the  same as in
  1155.      SETSUB.   Note  that  you  may  not delete a subdirectory if it has any
  1156.      files  left  in  it,  or  if  it is the main directory, or if it is the
  1157.      current default subdirectory.
  1158.  
  1159.      Example:
  1160.           TMP$=SUB$+CHR$(0)
  1161.           CALL DELSUB(TMP$,ERRCODE%)
  1162.           IF ERRCODE% THEN couldn't delete subdir ELSE subdir deleted
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.      Name: DGETSCREEN
  1198.  
  1199.      Type: Video / CLONE
  1200.  
  1201.      Description:
  1202.           Gets  part  of a screen display, and stores it in a dynamic array.
  1203.      This  function  is identical to GETSCREEN (see), except for its ability
  1204.      to  use  dynamic  as  well  as  static arrays for storage.  You need to
  1205.      use the DYNPTR routine to set up before calling this function.
  1206.  
  1207.      Example:
  1208.           OPTION BASE 1
  1209.           REM $DYNAMIC
  1210.           DIM SCREENARRAY%(2000)
  1211.            .
  1212.            .
  1213.           CALL DYNPTR(VARPTR(SCREENARRAY%(1)),DSEG%,DOFS%)
  1214.           CALL DGETSCREEN(DSEG%,DOFS%,TOPROW%,LFCOL%,BOTROW%,RTCOL%,
  1215.              PAGE%,SCRNMODE%)
  1216.           REM  the line split here is needed by my word processor,
  1217.           REM  and should not be present in actual code!
  1218.  
  1219.  
  1220.  
  1221.  
  1222.      Name: DPUTSCREEN
  1223.  
  1224.      Type: Video / CLONE
  1225.  
  1226.      Description:
  1227.           Puts  a  saved  screen display back on the screen.  Dynamic arrays
  1228.      can  be  used  with  this  function,  which  is  otherwise identical to
  1229.      PUTSCREEN  (see).   See  also  DGETSCREEN.   The DYNPTR routine must be
  1230.      used before calling this function.
  1231.  
  1232.      Example:
  1233.           OPTION BASE 1
  1234.           REM $DYNAMIC
  1235.           DIM SCREENARRAY%(2000)
  1236.            .
  1237.            .
  1238.           CALL DYNPTR(VARPTR(SCREENARRAY%(1),DSEG%,DOFS%)
  1239.           CALL DPUTSCREEN(DSEG%,DOFS%,TOPROW%,LFCOL%,BOTROW%,RTCOL%,
  1240.              PAGE%,SCRNMODE%)
  1241.           REM  the line split here is needed by my word processor,
  1242.           REM  and should not be present in actual code!
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.      Name: DISKSTAT
  1264.  
  1265.      Type: Disk / DOS
  1266.  
  1267.      Description:
  1268.           Returns  status  information  for  a  given disk drive.  The drive
  1269.      spec should be a letter, or use "@" for the default drive.  Information
  1270.      returned  will  be  Free  Clusters,  Total  Clusters, Bytes per Sector,
  1271.      and  Sectors  per Cluster.  This will enable you to calculate the total
  1272.      space  on  the  disk,  free  space  left on the disk, the actual amount
  1273.      of  space  a  file  takes up, and so forth.  A "cluster" is the minimum
  1274.      block  of  space  that  can  be allocated on a disk.  The actual amount
  1275.      of  space  taken  up  by  a  file  depends on the cluster size.  If the
  1276.      cluster  size  is  1024 bytes, any file that is listed as being between
  1277.      1  and  1024  bytes  will  take  up 1024 bytes of disk space.  Any file
  1278.      listed  as  having  1025  -  2047 bytes will take up 2048 bytes (1024 *
  1279.      2), and so on.
  1280.  
  1281.      Example:
  1282.           DRIVE$ = "@":  REM  Use the default drive
  1283.           CALL DISKSTAT(DRIVE$,FRE.CLUST%,TOT.CLUST%,BYTES.SEC%,SECS.CLUST%)
  1284.           CLUSTER.SIZE# = CDBL(BYTES.SEC%) * CDBL(SECS.CLUST%)
  1285.           FREE.DISK.SPACE# = CDBL(FRE.CLUST%) * CLUSTER.SIZE#
  1286.           TOTAL.DISK.SPACE# = CDBL(TOT.CLUST%) * CLUSTER.SIZE#
  1287.           PRINT "There are";FREE.DISK.SPACE#;" bytes free out of";
  1288.           PRINT TOTAL.DISK.SPACE#;" with";CLUSTER.SIZE#;" bytes per cluster"
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.      Name: DMPRINT
  1330.  
  1331.      Type: Video / DOS
  1332.  
  1333.      Description:
  1334.           Displays  a string at the current cursor position, using DOS calls
  1335.      for  output  (so  device  drivers  such  as  ANSI.SYS will work).  This
  1336.      routine  is  faster  than  MPRINT  (q.v.),  but offers fewer amenities.
  1337.      Character  translation  is  limited to what DOS provides, meaning that,
  1338.      for  instance,  Backspace  just  moves  the  cursor back without wiping
  1339.      out  the previous character.  Other control codes may not be translated
  1340.      as  you  might  hope,  either.   Finally,  since DOS provides no way of
  1341.      finding  the  current  print position, you have to figure out where the
  1342.      cursor  will  be  yourself if you need it (like other display routines,
  1343.      DMPRINT  does  not  update  the  BASIC  cursor position).  You can gain
  1344.      control  of  such  things  by  using the ANSI.SYS driver.  See your DOS
  1345.      manual for more information on that.
  1346.  
  1347.      Example:
  1348.           CALL DMPRINT(ST$)
  1349.  
  1350.  
  1351.  
  1352.  
  1353.      Name: DOSINKEY
  1354.  
  1355.      Type: Keyboard / DOS
  1356.  
  1357.      Description:
  1358.           Gets  a  key  from  the  standard  input device.  This is normally
  1359.      the  keyboard,  but  redirection  is  allowed  (to a file, or to a port
  1360.      via  CTTY).  Two parameters are returned: the first gives the key code,
  1361.      if  any,  and  the  second gives status information.  If the CHRTYPE is
  1362.      zero,  there  is  no  key  pressed.   If it is one, the key returned is
  1363.      a  normal  keypress.   If  it  is  two, the key returned is the code of
  1364.      an Extended ASCII key (like a function key or arrow key).
  1365.  
  1366.      Example:
  1367.           REM  This is an INKEY$-oriented routine to get a keypress.
  1368.           KY$ = ""
  1369.           WHILE KY$=""
  1370.               KY$ = INKEY$
  1371.           WEND
  1372.           IF LEN(KY$)=2 THEN EXTCODE=-1: KY$=RIGHT$(KY$,1) ELSE EXTCODE=0
  1373.           RETURN
  1374.  
  1375.           REM  This is the same routine, using DOSINKEY.
  1376.           CHRTYPE% = 0
  1377.           WHILE CHRTYPE%=0
  1378.               CALL DOSINKEY(CHRCODE%,CHRTYPE%)
  1379.           WEND
  1380.           KY$ = CHR$(CHRCODE%)
  1381.           IF CHRTYPE%=2 THEN EXTCODE%=-1 ELSE EXTCODE%=0
  1382.           RETURN
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.      Name: DRVSPACE
  1396.  
  1397.      Type: Disk / DOS
  1398.  
  1399.      Description:
  1400.           Returns  the  amount  of  free  space  left on a given disk drive.
  1401.      The  drive  string  may  be  any legal disk drive, or "@" (AT sign) for
  1402.      the default drive, and must be at least one character long.  An illegal
  1403.      drive or other error will cause free space to be returned as a negative
  1404.      value.  See also DISKSTAT.
  1405.  
  1406.      Example:
  1407.           DRV$="A:"
  1408.            .
  1409.            .
  1410.           CALL DRVSPACE(DRV$,A%,B%,C%)
  1411.           FREE# = CDBL(A%)*CDBL(B%)*CDBL(C%)
  1412.           PRINT"Free space on drive ";DRV$;" is";FREE#;"bytes."
  1413.  
  1414.  
  1415.  
  1416.  
  1417.      Name: DTR
  1418.  
  1419.      Type: Miscellaneous / CLONE
  1420.  
  1421.      Description:
  1422.           Switches  the  communications  signal  DTR  (Data  Terminal Ready)
  1423.      on  or  off.   Turning the DTR off has the effect of making most modems
  1424.      drop  carrier  (hang  up  the  phone).   The comm port should be one or
  1425.      two.  Use zero to turn the DTR off, or nonzero to turn it back on.
  1426.  
  1427.      Example:
  1428.           COMMPORT% = 1
  1429.           TOGGLE% = 0   : REM  turn the DTR off
  1430.           CALL DTR(COMMPORT%,TOGGLE%)
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.      Name: DYNPTR
  1462.  
  1463.      Type: Array / ANY
  1464.  
  1465.      Description:
  1466.           This  function sets up a dynamic array for use with those routines
  1467.      which  can  use  dynamic  arrays as parameters.  It converts the VARPTR
  1468.      for  the  array  into appropriate segment and offset values.  A segment
  1469.      of -1 is returned if an error occurs.
  1470.  
  1471.      Example:
  1472.           OPTION BASE 0
  1473.           REM $DYNAMIC
  1474.           DIM DARRAY%(2000)
  1475.             .
  1476.             .
  1477.           CALL DYNPTR(VARPTR(DARRAY%(0)),DARRAYSEG%,DARRAYOFS%)
  1478.           REM  DARRAYSEG% and DARRAYOFS% are the returned values 
  1479.  
  1480.  
  1481.  
  1482.  
  1483.      Name: EQUIPMENT
  1484.  
  1485.      Type: Miscellaneous / BIOS
  1486.  
  1487.      Description:
  1488.           Returns  basic  information  about  the  hardware configuration of
  1489.      the  computer: memory  installed,  in  kilobytes;  number  of  parallel
  1490.      (printer)  ports,  0-3;  number  of RS232 serial (comm) ports, 0-7; and
  1491.      number of game ports, 0-1.
  1492.  
  1493.      Example:
  1494.           CALL EQUIPMENT(MEMORY%,PARALLEL%,SERIAL%,GAME%)
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.      Name: EXIST
  1528.  
  1529.      Type: Disk / DOS
  1530.  
  1531.      Description:
  1532.           Tells  you  if  a  given  file already exists.  Returns zero if it
  1533.      doesn't,  or  a  nonzero  value if it does.  Requires an ASCIZ filename
  1534.      without  wildcards.   If  you  need  to use wildcards, or are operating
  1535.      in a network environment, use the FINDFIRSTF function instead.
  1536.  
  1537.      Example:
  1538.           FIL$="TEST.TXT"+CHR$(0)
  1539.           CALL EXIST(FIL$,FILEXISTS%)
  1540.           IF FILEXISTS% THEN PRINT "File already exists"
  1541.  
  1542.  
  1543.  
  1544.  
  1545.      Name: EXTRACT
  1546.  
  1547.      Type: String / ANY
  1548.  
  1549.      Description:
  1550.           Extracts  a  delimited  substring  from  a  string given an index.
  1551.      Requires  a  string  of  any  length,  a  delimiter of one character in
  1552.      length,  and  an  index value from 1-256; returns the starting location
  1553.      and  length  of  the  substring.   If the delimiter is null (an error),
  1554.      the  substring  length  will  be returned as -1.  If the index value is
  1555.      greater  than  the  number  of  delimited  substrings, a length of zero
  1556.      will be returned.
  1557.  
  1558.      Example:
  1559.           ST$="John Doe/15 Maple Rd/Hometown, CA 99199/(300) 111-1111"
  1560.           INDEX%=2
  1561.           DELIMITER$="/"
  1562.           CALL EXTRACT(ST$,DELIMITER$,INDEX%,START%,SLEN%)
  1563.           PRINT MID$(ST$,START%,SLEN%)
  1564.           REM  This will print the second substring (INDEX%=2) of the string
  1565.           REM  (ST$) delimited by "/" (DELIMITER$), which in this case
  1566.           REM  will be "15 Maple Rd".
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593.      Name: FCLOSE
  1594.  
  1595.      Type: Disk / DOS
  1596.  
  1597.      Description:
  1598.           Closes a file opened by MOPEN (q.v.)
  1599.  
  1600.      Related functions: MCREATE, MOPEN, MREAD, MSETEND, MSETREC, MWRITE.
  1601.  
  1602.      Example:
  1603.           CALL FCLOSE(HANDLE%)
  1604.  
  1605.  
  1606.  
  1607.  
  1608.      Name: FCREATE
  1609.  
  1610.      Type: Disk / DOS
  1611.  
  1612.      Description:
  1613.           Opens  a  file  with  a  given  attribute for read/write access in
  1614.      normal  mode.   If  the  file  doesn't exist, it's created; if it does,
  1615.      it's  set  to  zero  bytes in length.  A "handle" is returned, which is
  1616.      used  to  identify  the  file  (like  BASIC's file numbers).  See FOPEN
  1617.      for  an  explanation  of  modes.   For more information, see the end of
  1618.      this manual.
  1619.  
  1620.      Related functions: FOPEN, FREAD, FSETEND, FSETREC, FWRITE.
  1621.  
  1622.      Example:
  1623.           FIL$="TEST.TXT"+CHR$(0)
  1624.           ATTR%=0
  1625.           CALL FCREATE(FIL$,ATTR%,TEST.HANDLE%,ERRCODE%)
  1626.           IF ERRCODE% THEN PRINT "Couldn't create file"
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.      Name: FINDFIRSTF
  1660.  
  1661.      Type: Disk / DOS
  1662.  
  1663.      Description:
  1664.           Given  a  filename  (which  may contain the wildcards "*" and "?",
  1665.      and  a  drive  and  path  spec  if you like), this searches the default
  1666.      (or  specified)  directory  to  find  the first matching file.  Further
  1667.      matches  can  be  obtained  through  the  FINDNEXTF routine (q.v.).  If
  1668.      there  is  a  match,  ERCD%  will return zero, otherwise it will return
  1669.      a  positive  value  (unless  you entered a null filename, in which case
  1670.      ERCD%  will be -1 to flag an error).  You can retrieve various informa-
  1671.      tion  about  the  matched file via a number of supplementary functions:
  1672.      GETNAMEF  to  get  the filename, GETATTRF to get the attribute (there's
  1673.      a  page  at  the end of this document on file attributes), GETDATEF and
  1674.      GETTIMEF  to  get the date and time, and GETSIZEF to get the file size.
  1675.      You  may  specify  a search attribute as well: 0 (zero) to match normal
  1676.      files, 2 to match hidden files, 4 for system files, and 16 for subdirec-
  1677.      tories.   Attributes  other  than zero will return normal files as well
  1678.      as  the  specified  type,  and  you  can match on more than one kind of
  1679.      attribute (for instance, to get all kinds of files, you'd use an attri-
  1680.      bute  of 22, or 2+4+16).  You can read the volume label using an attri-
  1681.      bute  of  8,  which  is  supposed  to return only the volume label, but
  1682.      may not (see notes in the File Attribute info at the end of this file).
  1683.  
  1684.           This  function can be used to duplicate the DOS directory command,
  1685.      or to allow filename wildcards in your program, among other things.
  1686.  
  1687.      Example:
  1688.           FIL$=FIL$+CHR$(0)
  1689.           CALL FINDFIRSTF(FIL$,ATTR%,ERCD%)
  1690.           IF ERCD% THEN PRINT"No matching files"
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.      Name: FINDNEXTF
  1726.  
  1727.      Type: Disk / DOS
  1728.  
  1729.      Description:
  1730.           This  is  used  after  the  FINDFIRSTF function (q.v.) in order to
  1731.      find further matching files.
  1732.  
  1733.      Example:
  1734.           CALL FINDNEXTF(ERCD%)
  1735.           IF ERCD% THEN PRINT"No more matching files"
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.      Name: FOPEN
  1792.  
  1793.      Type: Disk / DOS
  1794.  
  1795.      Description:
  1796.           Opens  an  already-existing  file.   If  you  want to create a new
  1797.      file,  use  the  FCREATE  function.   You  tell  it the ASCIZ filename,
  1798.      ACCESS%  method,  and  MODE%; it gives back a HANDLE% or ERRCODE%.  The
  1799.      ACCESS%  method  is  how  you want to open the file: 0, read; 1, write;
  1800.      2, read/write.  The MODE% controls access to the file by other programs
  1801.      operating  at  the same time, and is hence only useful for multitasking
  1802.      or  networking.   MODE%  is: 0, normal (no multitasking or networking);
  1803.      1,  exclusive  (no  other  program  can access the file); 2, deny write
  1804.      (no  other program may change the file); 3, deny read (no other program
  1805.      may  look  at  the  file);  4,  deny none (any other program may access
  1806.      the  file).   To  activate  handling of nonzero modes, you must execute
  1807.      the  DOS  utility  SHARE, which is included on your DOS disk.  For more
  1808.      information, see the end of this manual.
  1809.  
  1810.      Related functions: FCLOSE, FCREATE, FREAD, FSETEND, FSETREC, FWRITE.
  1811.  
  1812.      Example:
  1813.           FIL$="TEST.TXT"+CHR$(0)
  1814.           FACCESS%=2  : REM  Open the file with read/write access
  1815.           FMODE%=0    : REM  Normal mode, not networking or multitasking
  1816.           CALL FOPEN(FIL$,FACCESS%,FMODE%,TEST.HANDLE%,ERRCODE%)
  1817.           IF ERRCODE% THEN PRINT "Unable to open the file"
  1818.  
  1819.      Example:
  1820.           FIL$="C:\DOCUMENT\TEST.TXT"+CHR$(0)
  1821.           FACCESS%=2  : REM  Open the file for read access
  1822.           FMODE%=2    : REM  Deny Write mode, for networking/multitasking
  1823.           REM  We "deny write" so nobody else can change the file while
  1824.           REM
  1825.                we're reading it.  We'll let others read from the file while
  1826.           REM  we are, though.  (This works like Normal mode if SHARE wasn't
  1827.           REM  executed)
  1828.           CALL FOPEN(FIL$,FACCESS%,FMODE%,TEST.HANDLE%,ERRCODE%)
  1829.           IF ERRCODE% THEN PRINT "Unable to open file"
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.      Name: FREAD
  1859.  
  1860.      Type: Disk / DOS
  1861.  
  1862.      Description:
  1863.           Reads  information  from  a  file opened by FOPEN or FCREATE.  You
  1864.      tell  it  which  file  to  read  from by giving it the handle which was
  1865.      returned  when  you  opened  the  file.   You give it a buffer location
  1866.      to read into, which can be either an array (for use, say, with SCRREST)
  1867.      or  a string (for more usual purposes).  You are responsible for seeing
  1868.      that  the  buffer  is  large enough to hold all the bytes that you want
  1869.      to read!
  1870.           FREAD  returns  a  nonzero  ERRCODE%  if  anything went wrong.  If
  1871.      ERRCODE% is -1, it was able to read only part of the information before
  1872.      hitting  an  end  of  file.  In that case, BYTESREAD% will tell you how
  1873.      many  bytes  were  actually  read  in.   See the end of this manual for
  1874.      info on error codes.
  1875.  
  1876.      Related functions: FCLOSE, FCREATE, FOPEN, FSETEND, FSETREC, FWRITE
  1877.  
  1878.      Example:
  1879.           OPTION BASE 1: DIM ARRAY%(2000): REM  Set up the array buffer
  1880.            .
  1881.            .
  1882.           REM  Do a FOPEN to open the file
  1883.           BUFFER%=VARPTR(ARRAY%(1)): REM  Use first element of array here
  1884.           BYTES%=4000: REM  Read in 4000-byte saved screen into the array
  1885.           CALL FREAD(HANDLE%,BUFFER%,BYTES%,BYTESREAD%,ERRCODE%)
  1886.           IF ERRCODE% THEN PRINT "Error reading file..."
  1887.           REM  Do a SCRREST to put the info on the screen
  1888.  
  1889.      Example:
  1890.           BYTES%=128          : REM  Read in 128 bytes/characters
  1891.       
  1892.           BUF$=SPACE$(BYTES%) : REM  Set up the string buffer
  1893.           V%=VARPTR(BUF$)
  1894.           BUFFER%=PEEK(V%+2)+PEEK(V%+3)*256
  1895.           CALL FREAD(HANDLE%,BUFFER%,BYTES%,BYTESREAD%,ERRCODE%)
  1896.           IF ERRCODE% THEN PRINT "Error reading file..."
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.      Name: FSETEND
  1926.  
  1927.      Type: Disk / DOS
  1928.  
  1929.      Description:
  1930.           For  use  with  files  opened with FOPEN / FCREATE.  This function
  1931.      sets  the  file pointer to the end of the file, so that any information
  1932.      written using FWRITE will be appended to the file.
  1933.  
  1934.      Related functions: FCLOSE, FCREATE, FOPEN, FREAD, FSETREC, FWRITE
  1935.  
  1936.      Example:
  1937.           CALL FSETEND(HANDLE%)
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.      Name: FSETREC
  1992.  
  1993.      Type: Disk / DOS
  1994.  
  1995.      Description:
  1996.           For  use  with  files  opened with FOPEN / FCREATE.  This function
  1997.      sets  the  file  pointer to a given record in the file, so that it will
  1998.      be the next record read or written.
  1999.  
  2000.      Related functions: FCLOSE, FCREATE, FOPEN, FREAD, FSETEND, FWRITE
  2001.  
  2002.      Example:
  2003.           RECSIZE%=128: REM  Number of bytes in a record in our file
  2004.           RECNO%=34: REM  Record number (starting from 1, as in BASIC)
  2005.           CALL FSETREC(HANDLE%,RECSIZE%,RECNO%)
  2006.  
  2007.  
  2008.  
  2009.  
  2010.      Name: FWRITE
  2011.  
  2012.      Type: Disk / DOS
  2013.  
  2014.      Description:
  2015.           Allows  you  to  write  to a file opened by FOPEN or FCREATE.  The
  2016.      parameters  are  the same as in FREAD (q.v.), except for BYTESWRITTEN%,
  2017.      which replaces BYTESREAD%.
  2018.  
  2019.      Related functions: FCLOSE, FCREATE, FOPEN, FREAD, FSETEND, FSETREC
  2020.  
  2021.      Example:
  2022.           REM  Do a SCRSAVE to save a screen into ARRAY%()
  2023.           BUFFER%=VARPTR(ARRAY%(1))
  2024.           BYTES%=4000: REM  4000 bytes = 2000 integer array elements
  2025.           CALL FWRITE(TEST.HANDLE%,BUFFER%,BYTES%,BYTESWRITTEN%,ERRCODE%)
  2026.           IF ERRCODE% THEN PRINT "Unable to write to file..."
  2027.           REM  See FREAD for an example of how to set up a string buffer
  2028.           REM  as the setup is different than when using an array buffer
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.      Name: GETATTRF
  2058.  
  2059.      Type: Disk / DOS
  2060.  
  2061.      Description:
  2062.           Returns  the  actual  attribute of a file matched using FINDFIRSTF
  2063.      or  FINDNEXTF.   See  the  end of this document for information on file
  2064.      attributes.
  2065.  
  2066.      Example:
  2067.           REM  use this AFTER calling FINDFIRSTF / FINDNEXTF to initialize
  2068.           REM  the appropriate file information!
  2069.           CALL GETATTRF(ATTR%)
  2070.  
  2071.  
  2072.  
  2073.  
  2074.      Name: GETCRT
  2075.  
  2076.      Type: Video / BIOS
  2077.  
  2078.      Description:
  2079.           Tells  you what kind of display is being used.  The returned value
  2080.      will be reset if it's monochrome, or set if color.  See also GETEGA.
  2081.  
  2082.      Example:
  2083.           CALL GETCRT(COLORDISPLAY%)
  2084.           IF COLORDISPLAY% THEN PRINT"Color" ELSE PRINT"Monochrome"
  2085.  
  2086.  
  2087.  
  2088.  
  2089.      Name: GETEXTM
  2090.  
  2091.      Type: Miscellaneous / AT BIOS
  2092.  
  2093.      Description:
  2094.           Tells  you  how  much extended memory is available.  This function
  2095.      requires  the  AT  BIOS,  and  shouldn't  be  used  with PCs.  See also
  2096.      GETLIMM.
  2097.  
  2098.      Example:
  2099.           CALL GETEXTM(KBYTES%)
  2100.           PRINT KBYTES%;" kilobytes of extended memory"
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.  
  2120.  
  2121.  
  2122.  
  2123.      Name: GETKBD
  2124.  
  2125.      Type: Input / CLONE
  2126.  
  2127.      Description:
  2128.           Gives  the  status  of  the  keyboard  toggles.  The variable will
  2129.      be set if the toggle is on, and reset if it is off.  See also SETKBD.
  2130.  
  2131.      Example:
  2132.           CALL GETKBD(INSERT%,CAPSLOCK%,NUMLOCK%,SCROLLLOCK%)
  2133.           IF INSERT% THEN PRINT"Insert mode is on"
  2134.           IF CAPSLOCK% THEN PRINT"Caps Lock is on"
  2135.           IF NUMLOCK% THEN PRINT"The keypad is in numeric mode"
  2136.           IF SCROLLLOCK% THEN PRINT"Scroll Lock is on"
  2137.  
  2138.  
  2139.  
  2140.  
  2141.      Name: GETDATEF
  2142.  
  2143.      Type: Disk / DOS
  2144.  
  2145.      Description:
  2146.           Returns the date associated with the file matched using FINDFIRSTF
  2147.      or FINDNEXTF.
  2148.  
  2149.      Example:
  2150.           CALL GETDATEF(MONTH%,DAY%,YEAR%)
  2151.  
  2152.  
  2153.  
  2154.  
  2155.      Name: GETDOSV
  2156.  
  2157.      Type: Miscellaneous / DOS
  2158.  
  2159.      Description:
  2160.           Gets  MS-DOS  version.  The major version is returned in the first
  2161.      parameter,  the minor version in the second (e.g., MS-DOS v. 2.11 would
  2162.      return MAJ% = 2, MIN% = 11).
  2163.  
  2164.      Example:
  2165.           CALL GETDOSV(MAJ%,MIN%)
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.  
  2187.  
  2188.  
  2189.      Name: GETDRV
  2190.  
  2191.      Type: Disk / DOS
  2192.  
  2193.      Description:
  2194.           Returns  the  letter  of the default drive.  The drive string must
  2195.      be at least one character long.
  2196.  
  2197.      Example:
  2198.           DRV$="x:": CALL GETDRV(DRV$)
  2199.  
  2200.  
  2201.  
  2202.  
  2203.      Name: GETEGA
  2204.  
  2205.      Type: Video / BIOS
  2206.  
  2207.      Description:
  2208.           Tells  you  if  the display is an Enhanced Graphics Adapter (EGA).
  2209.      See also GETCRT.
  2210.  
  2211.      Example:
  2212.           CALL GETEGA(DISPTYPE%)
  2213.           IF DISPTYPE% THEN PRINT"It's an EGA" ELSE PRINT"Not an EGA"
  2214.  
  2215.  
  2216.  
  2217.  
  2218.      Name: GETFATTR
  2219.  
  2220.      Type: Disk / DOS
  2221.  
  2222.      Description:
  2223.           Gets  the attribute of a file.  See the section on file attributes
  2224.      at the end of this manual.
  2225.  
  2226.      Example:
  2227.           FIL$=FIL$+CHR$(0)
  2228.           CALL GETFATTR(FIL$,ATTR%)
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.  
  2253.  
  2254.  
  2255.      Name: GETFDATE
  2256.  
  2257.      Type: Disk / DOS
  2258.  
  2259.      Description:
  2260.           GETFDATE  returns  the  file  creation date, that is, the date you
  2261.      see  on  a  file  when  you  get  a  DIRectory.   The file name must be
  2262.      terminated  with  a NUL character.  If there is an error, such as there
  2263.      being no such file, the month will be set to -1.
  2264.  
  2265.      Example:
  2266.           FIL$="TESTFILE.TXT"+CHR$(0)
  2267.           CALL GETFDATE(FIL$,MONTH%,DAY%,YEAR%)
  2268.  
  2269.  
  2270.  
  2271.  
  2272.      Name: GETFTIME
  2273.  
  2274.      Type: Disk / DOS
  2275.  
  2276.      Description:
  2277.           This  function complements GETFDATE, and returns the file creation
  2278.      time.   The  hour is in 24-hour (military) format, and will be returned
  2279.      as  -1  if  there  is no such file or a bad file name.  The seconds are
  2280.      rounded  to  the next lower even number, due to the DOS storage format.
  2281.      The file name must be terminated with a NUL character.
  2282.  
  2283.      Example:
  2284.           FIL$="ANYFILE.EXT"+CHR$(0)
  2285.           CALL GETFTIME(FIL$,HOUR%,MINUTE%,SECOND%)
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320.  
  2321.      Name: GETKEY
  2322.  
  2323.      Type: Keyboard / BIOS
  2324.  
  2325.      Description:
  2326.           Waits  until  one  of  a  list of keys is pressed, and returns it.
  2327.      The  key  list  (any  length)  should be uppercase.  If the key list is
  2328.      null,  the  first  key pressed will be returned.  The key returned will
  2329.      be  capitalized.   The  variable  to return the key in must be at least
  2330.      one  character  long.   This  function is designed for returning one of
  2331.      a menu of choices, for example.
  2332.  
  2333.      Example:
  2334.           PRINT "Would you like to try again (Y/N)? ";
  2335.           GOODKEYS$="YN" : REM  Allow Y or N
  2336.             .
  2337.             .
  2338.           KY$="x": CALL GETKEY(GOODKEYS$,KY$)
  2339.  
  2340.  
  2341.  
  2342.  
  2343.      Name: GETLIMM
  2344.  
  2345.      Type: Miscellaneous / BIOS
  2346.  
  2347.      Description:
  2348.           Returns  the  status  of  expanded memory, in total pages and free
  2349.      pages  (where  a  page  is  16k  bytes).   Total  pages will be zero if
  2350.      expanded  memory  is not installed, or if the LIM driver is not active.
  2351.      See also GETEXTM.
  2352.  
  2353.      Example:
  2354.           CALL GETLIMM(TOTPAGES%,FREEPAGES%)
  2355.           PRINT TOTPAGES%;"pages of expanded memory are installed."
  2356.           IF TOTPAGES%>0 THEN PRINT FREEPAGES%;"pages of that are free."
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.  
  2385.  
  2386.  
  2387.      Name: GETLINE
  2388.  
  2389.      Type: Video / ANY
  2390.  
  2391.      Description:
  2392.           Returns  a  selected  line  from  a screen saved via SCRSAVE, with
  2393.      the  trailing  spaces  removed.   The  line  string must be at least 80
  2394.      characters  long.   This  will  also  return a line from a screen saved
  2395.      with GETSCREEN, as long as full 80-column lines were saved.  You cannot
  2396.      use this function with dynamic arrays (screens saved with DGETSCREEN).
  2397.  
  2398.      Example:
  2399.           OPTION BASE 1: DIM SCR%(2000)
  2400.           WHERE%=VARPTR(SCR%(1)): CALL SCRSAVE(WHERE%): CLS
  2401.           LINENR%=10: LIN$=SPACE$(80): WHERE%=VARPTR(SCR%(1))
  2402.           CALL GETLINE(WHERE%,LINENR%,LIN$,LLEN%)
  2403.           PRINT"Line 10 was:": PRINT LEFT$(LIN$,LLEN%)
  2404.  
  2405.  
  2406.  
  2407.  
  2408.      Name: GETNAMEF
  2409.  
  2410.      Type: Disk / DOS
  2411.  
  2412.      Description:
  2413.           Returns  the  filename  of  the  file  matched using FINDFIRSTF or
  2414.      FINDNEXTF.   The FIL$ string must be initialized to at least 12 charac-
  2415.      ters  in  length.  The actual length of FIL$ will be returned in FLEN%,
  2416.      which  will  be  -1  if  you  didn't initialize FIL$ long enough.  Note
  2417.      that the filename will not contain a drive or path spec.
  2418.  
  2419.      Example:
  2420.           FIL$=SPACE$(12)
  2421.           CALL GETNAMEF(FIL$,FLEN%)
  2422.           FIL$=LEFT$(FIL$,FLEN%)
  2423.  
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.  
  2450.  
  2451.  
  2452.  
  2453.      Name: GETSCREEN
  2454.  
  2455.      Type: Video / CLONE
  2456.  
  2457.      Description:
  2458.           Allows  you  to  save  any  part  of a text screen display (on any
  2459.      page,  active  or  inactive,  if  you  have  a color graphics adapter).
  2460.      You  need  to  specify  an  integer array where the information will be
  2461.      stored,  the  coordinates  of  the  upper  left corner and bottom right
  2462.      corner  of  the  part  of the screen to save, the display page to save,
  2463.      and the screen mode.
  2464.           The  screen  mode  should  be  zero for flicker-free screen saving
  2465.      if  you  have  a  low quality color graphics adapter and are saving the
  2466.      currently-active  display  page.   Otherwise, set it to 1 or -1 for the
  2467.      fastest save speed.
  2468.           You  specify  the  area  of  the screen to save as a rectangle, by
  2469.      giving  the  locations of the upper leftmost corner and lower rightmost
  2470.      corner  of  the  area  to save.  This can range from a single character
  2471.      to  the entire screen.  Make sure that the coordinates do not get mixed
  2472.      up, or you will get unpredictable results.
  2473.           To  figure  out  how  many array elements you need to save an area
  2474.      of the screen, use the following calculation:
  2475.      ELEMENTS%=(BOTTOMROW%-TOPROW%+1)*(RIGHTCOLUMN%-LEFTCOLUMN%+1)
  2476.      You  can  store  multiple  screen  areas in one array by specifying the
  2477.      proper  starting  element,  which  must be one after the previous saved
  2478.      area.   You'll  have  to  keep track of where each saved area is in the
  2479.      array yourself.
  2480.           If you have a monochrome adapter, or are not using unusual display
  2481.      pages, you should set the page specification to zero.
  2482.           Note  that  you don't have to restore the saved area of the screen
  2483.      (see  PUTSCREEN)  to  the same area it was taken from.  This allows you
  2484.      to move windows around, change the shape of windows, and other interes-
  2485.      ting tricks...
  2486.           See  also  PUTSCREEN,  to  restore a given area of the screen; and
  2487.      SCRSAVE, SCRREST, SCRSAVEP, SCRRESTP, SCRSAVEPD, and SCRRESTPD, earlier
  2488.      versions  of  similar  functions.  Note that if you save/restore a full
  2489.      80-column,  25-row  screen,  the  information in the save/restore array
  2490.      is    identical    whether    you're   using   GETSCREEN/PUTSCREEN   or
  2491.      SCRSAVExx/SCRRESTxx.   On  that  level,  the  routines  are  completely
  2492.      compatible.
  2493.  
  2494.      Example:
  2495.      CALL GETSCREEN(SCRN%(0),TOPROW%,LFCOL%,BOTROW%,RTCOL%,PAGE%,SCRNMODE%)
  2496.        REM  SCRN%(0) is the location in the array to save the area to.
  2497.        REM  TOPROW%,LFCOL% and BOTROW%,RTCOL% are the corners of the area.
  2498.        REM  PAGE% is the display page number (0-3 if Color, 0 if Mono).
  2499.        REM  SCRNMODE% is screen access mode: 0, snowless; 1 / -1, fast.
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.  
  2517.  
  2518.  
  2519.      Name: GETSIZEF
  2520.  
  2521.      Type: Disk / DOS
  2522.  
  2523.      Description:
  2524.           Returns  the size of the file matched via FINDFIRSTF or FINDNEXTF.
  2525.      Since  the  file  size  may  be  outside  integer bounds, there is some
  2526.      additional code you will have to add which uses double-precision values
  2527.      (see  the example).  You can modify the example to use single-precision
  2528.      instead,  but  really large file sizes will then lapse into exponential
  2529.      notation.
  2530.  
  2531.      Example:
  2532.           CALL GETSIZEF(SIZELOW%,SIZEHIGH%)
  2533.           SIZELOW#=CDBL(SIZELOW%)
  2534.           IF SIZELOW%<0 THEN SIZELOW#=SIZELOW#+65536#
  2535.           FILESIZE#=SIZELOW#+CDBL(SIZEHIGH%)*65536#
  2536.  
  2537.  
  2538.  
  2539.  
  2540.      Name: GETSUB
  2541.  
  2542.      Type: Disk / DOS
  2543.  
  2544.      Description:
  2545.           Gets  the  default  subdirectory.   The  subdirectory  string must
  2546.      be  64  characters  long,  and it is recommended that you set it to NUL
  2547.      characters.   Note  that  the  returned  string  will NOT be started by
  2548.      a backslash "\" character-- you should add one if appropriate.
  2549.  
  2550.      Example:
  2551.           SUB$=STRING$(64,0)
  2552.           CALL GETSUB(SUB$,SLEN%)
  2553.           SUB$="\"+LEFT$(SUB$,SLEN%)
  2554.  
  2555.  
  2556.  
  2557.  
  2558.      Name: GETTIMEF
  2559.  
  2560.      Type: Disk / DOS
  2561.  
  2562.      Description:
  2563.           Returns  the  time  associated with the file matched by FINDFIRSTF
  2564.      or FINDNEXTF.  The hour is returned in military (24-hour) format.
  2565.  
  2566.      Example:
  2567.           CALL GETTIMEF(HOUR%,MINUTE%,SECOND%)
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584.  
  2585.      Name: INSCHR
  2586.  
  2587.      Type: Video / CLONE
  2588.  
  2589.      Description:
  2590.           Inserts  a  space at the specified screen location.  The character
  2591.      previously  at  that  position  and  all  characters to the right of it
  2592.      on  the  same  screen  line  will  be shifted right one space.  Subject
  2593.      to the same limitations as DELCHR (q.v.).
  2594.  
  2595.      Example:
  2596.           COL%=POS(0): ROW%=CSRLIN
  2597.           CALL INSCHR(ROW%,COL%): PRINT"*";
  2598.  
  2599.  
  2600.  
  2601.  
  2602.      Name: INT2DATE
  2603.  
  2604.      Type: Miscellaneous / ANY
  2605.  
  2606.      Description:
  2607.           Decompresses  a  date  squeezed  using  DATE2INT (q.v.).  The year
  2608.      will be a four-digit value (1900-2026).
  2609.  
  2610.      Example:
  2611.           CALL INT2DATE(MONTH%,DAY%,YEAR%,SQZDATE%)
  2612.  
  2613.  
  2614.  
  2615.  
  2616.      Name: INT2TIME
  2617.  
  2618.      Type: Miscellaneous / ANY
  2619.  
  2620.      Description:
  2621.           Decompresses  a  time squeezed using TIME2INT (q.v.).  The seconds
  2622.      will be an even value (rounded down) due to the storage format.
  2623.  
  2624.      Example:
  2625.           CALL INT2TIME(HOUR%,MIN%,SEC%,SQZTIME%)
  2626.  
  2627.  
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.  
  2648.  
  2649.  
  2650.  
  2651.      Name: KEYPRESS
  2652.  
  2653.      Type: Keyboard / BIOS
  2654.  
  2655.      Description:
  2656.           Tells  you  whether  a  key is waiting in the keyboard buffer (for
  2657.      use  with  INKEY$  routines,  etc).   KYHIT is set if a key is waiting,
  2658.      cleared otherwise.
  2659.  
  2660.      Example:
  2661.           100 CALL KEYPRESS(KYHIT%)
  2662.               IF KYHIT% THEN KY$=INKEY$ ELSE 100
  2663.  
  2664.  
  2665.  
  2666.  
  2667.      Name: LOCASE
  2668.  
  2669.      Type: String / ANY
  2670.  
  2671.      Description:
  2672.           Converts a string to all lowercase characters.
  2673.  
  2674.      Example:
  2675.           MSG$="THis IS a test OF tHe lowercase CONVERTER!"
  2676.             .
  2677.             .
  2678.           CALL LOCASE(MSG$)
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.  
  2714.  
  2715.  
  2716.  
  2717.      Name: LROTATE
  2718.  
  2719.      Type: String / ANY
  2720.  
  2721.      Description:
  2722.           Rotates  the  characters  in a string left.  That is, the leftmost
  2723.      character  is  removed,  and  tacked  onto the end of the string.  This
  2724.      is  useful  for  rotating  queues and for character-graphics animation.
  2725.      If the string is of length one or less, it is returned unchanged.
  2726.  
  2727.      Example:
  2728.           ST$="12345"
  2729.           CALL LROTATE(ST$)
  2730.           REM  ST$ will end up being "23451"
  2731.  
  2732.  
  2733.  
  2734.  
  2735.      Name: MAKESUB
  2736.  
  2737.      Type: Disk / DOS
  2738.  
  2739.      Description:
  2740.           Makes  a  subdirectory.   Use  a  NUL-terminated string to specify
  2741.      the  subdirectory.   An  error  code  will  be returned if there was an
  2742.      error.
  2743.  
  2744.      Example:
  2745.           TMP$=SUB$+CHR$(0)
  2746.           CALL MAKESUB(TMP$,ERRCODE%)
  2747.           IF ERRCODE% THEN couldn't make subdir ELSE subdir created
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781.  
  2782.  
  2783.      Name: MAKEWINDOW
  2784.  
  2785.      Type: Video / CLONE
  2786.  
  2787.      Description:
  2788.           Creates  a  pop-up  window  on the screen.  You specify the window
  2789.      by  giving  the  upper left corner and lower right corner of the inside
  2790.      of  the  window.   The  frame  is  drawn  -outside-  the  window you've
  2791.      specified, so be sure to allow room for the frame!  For normal windows,
  2792.      the  frame  takes up only one column or row on each side.  For shadowed
  2793.      windows,  the  frame  will  instead  take  up three columns on the left
  2794.      and three rows on the bottom.
  2795.  
  2796.           There are four types of window:
  2797.      0, Normal:   the window pops onto the screen.
  2798.      1, Growing:  the window "grows" from a spot to a full-sized window.
  2799.      2,  Shadowed:  the  window  is shadowed on the left and bottom for a 3D
  2800.         effect.
  2801.      3, Growing/Shadowed: the window is shadowed and grows.
  2802.  
  2803.           You may also choose five types of frames:
  2804.      0, None: composed of spaces.
  2805.      1, Single: composed of a single line.
  2806.      2, Double: composed of a double line.
  2807.      3,  Double/Single:  made with a double vertical and a single horizontal
  2808.         line.
  2809.      4,  Single/Double:  made with a single vertical and a double horizontal
  2810.         line.
  2811.  
  2812.           You  must select fore and background colors.  A label is optional.
  2813.      If  you  give  one, it is bracketed within the top of the frame, on the
  2814.      left side.  The screen page is selectable on color monitors.
  2815.  
  2816.      Example:
  2817.           LCOL%=5:  TROW%=5:  REM  top left corner
  2818.           RCOL%=79: BROW%=20: REM  bottom right corner
  2819.           LABEL$="Test Window"
  2820.           FORE%=7: BACK%=0:   REM  color/attributes
  2821.           PAGE%=0:           REM  screen display page
  2822.           FRAME%=1:          REM  single-line frame
  2823.           TYPE%=3:           REM  growing, shadowed window
  2824.           CALL MAKEWINDOW(LCOL%,TROW%,RCOL%,BROW%,LABEL$,
  2825.                           FRAME%,TYPE%,FORE%,BACK%,PAGE%)
  2826.           REM  the above line shouldn't be divided in your program!
  2827.           REM  it's separated like that to accommodate my word processor.
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.  
  2846.  
  2847.  
  2848.  
  2849.      Name: MDELCHR
  2850.  
  2851.      Type: Video / BIOS
  2852.  
  2853.      Description:
  2854.           Deletes  the  character  at the current cursor position.  It obeys
  2855.      the  window  defined  by  MWINDOW.   It's  more compatible than DELCHR,
  2856.      but much slower.
  2857.             Note  that  this  routine  can  be  used to scroll a window left
  2858.      by  doing an MDELCHR at the first location of each line to be scrolled.
  2859.      To scroll right, do the same using MINSCHR instead.
  2860.  
  2861.      Example:
  2862.           CALL MDELCHR
  2863.  
  2864.  
  2865.  
  2866.  
  2867.      Name: MINSCHR
  2868.  
  2869.      Type: Video / BIOS
  2870.  
  2871.      Description:
  2872.           Inserts a space at the current cursor position, obeying the window
  2873.      defined by MWINDOW.  See notes at MDELCHR.
  2874.  
  2875.      Example:
  2876.           CALL MINSCHR
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.  
  2912.  
  2913.  
  2914.  
  2915.      Name: MMBUTTON
  2916.  
  2917.      Type: Input / BIOS
  2918.  
  2919.      Description:
  2920.           Returns  which  mouse  buttons are currently being held down.  See
  2921.      also MMCLICK.
  2922.  
  2923.      Example:
  2924.           CALL MMBUTTON(LFT%,RGT%)
  2925.           IF LFT% THEN PRINT"The left button is being pressed."
  2926.           IF RGT% THEN PRINT"The right button is being pressed."
  2927.  
  2928.  
  2929.  
  2930.  
  2931.      Name: MMCHECK
  2932.  
  2933.      Type: Input / BIOS
  2934.  
  2935.      Description:
  2936.           Returns  whether  a  mouse  is  installed, and how many buttons it
  2937.      has if it is installed.
  2938.  
  2939.      Example:
  2940.           CALL MMCHECK(MOUSE%)
  2941.           IF MOUSE% THEN PRINT"A mouse with ";MOUSE%;" buttons is present."
  2942.  
  2943.  
  2944.  
  2945.  
  2946.      Name: MMCLICK
  2947.  
  2948.      Type: Input / BIOS
  2949.  
  2950.      Description:
  2951.           Returns  which  mouse  buttons  have  been  clicked since you last
  2952.      used this function.  See also MMBUTTON.
  2953.  
  2954.      Example:
  2955.           CALL MMCLICK(LFT%,RGT%)
  2956.           IF LFT% THEN PRINT"The left button was pressed."
  2957.           IF RGT% THEN PRINT"The right button was pressed."
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.  
  2978.  
  2979.  
  2980.  
  2981.      Name: MMCURSORON
  2982.  
  2983.      Type: Input / BIOS
  2984.  
  2985.      Description:
  2986.           Makes  the  cursor  associated  with  the  mouse visible.  This is
  2987.      normally  a  blinking  block,  and  shows  where the mouse is currently
  2988.      pointing.  See also MMCURSOROFF.
  2989.  
  2990.      Example:
  2991.           CALL MMCURSORON
  2992.  
  2993.  
  2994.  
  2995.      Name: MMCURSOROFF
  2996.  
  2997.      Type: Input / BIOS
  2998.  
  2999.      Description:
  3000.           Makes  the  cursor  associated with the mouse invisible.  See also
  3001.      MMCURSORON.
  3002.  
  3003.      Example:
  3004.           CALL MMCURSOROFF
  3005.  
  3006.  
  3007.  
  3008.  
  3009.      Name: MMGETLOC
  3010.  
  3011.      Type: Input / BIOS
  3012.  
  3013.      Description:
  3014.           Gets  the  current location of the mouse cursor.  This is returned
  3015.      as  a  value  from  0-639 for columns, and 0-199 for rows.  You need to
  3016.      adjust  this  for  the  current screen format.  If you're in text mode,
  3017.      divide  the  columns  by eight and the rows by eight.  If you're in low
  3018.      res  graphics  mode,  divide the columns by two.  If you're in high res
  3019.      graphics, the numbers are fine.
  3020.  
  3021.      Example:
  3022.           CALL MMGETLOC(COL%,ROW%)
  3023.           LOCATE ROW%,COL%: PRINT "!";
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044.  
  3045.  
  3046.  
  3047.      Name: MMSETLOC
  3048.  
  3049.      Type: Input / BIOS
  3050.  
  3051.      Description:
  3052.           Sets  the current value of the mouse cursor.  Uses the same format
  3053.      as MMGETLOC (q.v.).
  3054.  
  3055.      Example:
  3056.           COL%=40*8-8: ROW%=24*8-8: REM  middle of the text-mode screen
  3057.           CALL MMSETLOC(COL%,ROW%)
  3058.  
  3059.  
  3060.  
  3061.  
  3062.      Name: MMSETRANGE
  3063.  
  3064.      Type: Input / BIOS
  3065.  
  3066.      Description:
  3067.           Sets  the  range  of  locations  where the mouse cursor is allowed
  3068.      to  be.   This  is  done  by specifying the upper left corner and lower
  3069.      right  corner  of  the  edges  of  the mouse input field.  Use the same
  3070.      format as MMGETLOC (q.v.).
  3071.  
  3072.      Example:
  3073.           LFTCOL%=20*8-8: TOPROW%=1*8-8
  3074.           RGTCOL%=60*8-8: BOTROW%=10*8-8
  3075.           CALL MMSETRANGE(LFTCOL%,TOPROW%,RGTCOL%,BOTROW%)
  3076.           REM  sets up a text-mode input field
  3077.  
  3078.  
  3079.  
  3080.  
  3081.  
  3082.  
  3083.  
  3084.  
  3085.  
  3086.  
  3087.  
  3088.  
  3089.  
  3090.  
  3091.  
  3092.  
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.  
  3099.  
  3100.  
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106.  
  3107.  
  3108.  
  3109.  
  3110.  
  3111.  
  3112.  
  3113.      Name: MLOAD
  3114.  
  3115.      Type: Disk / DOS
  3116.  
  3117.      Description:
  3118.           Works  the  same  way  as  the  BLOAD statement does.  This is for
  3119.      use  with older compilers, which don't have the BLOAD statement.  MLOAD
  3120.      restores the information to the same place it was when BSAVEd.
  3121.  
  3122.      Example:
  3123.           FIL$="SCRNSAVE.BIN"+CHR$(0)
  3124.           CALL MLOAD(FIL$)
  3125.  
  3126.  
  3127.  
  3128.  
  3129.      Name: MONTH
  3130.  
  3131.      Type: Miscellaneous / ANY
  3132.  
  3133.      Description:
  3134.           Given  the  number  of  a  month  (1-12), this routine returns the
  3135.      name  of  the  month  (January  -  December).  You must supply a string
  3136.      of at least nine spaces in length to hold the month.
  3137.  
  3138.      Example:
  3139.           MONTH$=SPACE$(9)
  3140.           CALL MONTH(MONTH$,MLENGTH%,MONTHNUMBER%)
  3141.           MONTH$=LEFT$(MONTH$,MLENGTH%)
  3142.  
  3143.  
  3144.  
  3145.  
  3146.  
  3147.  
  3148.  
  3149.  
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.  
  3176.  
  3177.  
  3178.  
  3179.      Name: MPRINTC
  3180.  
  3181.      Type: Video / BIOS
  3182.  
  3183.      Description:
  3184.           Using  this  function,  you  can  access  device  drivers  such as
  3185.      ANSI.SYS.   This  is  a video output function which goes through MS-DOS
  3186.      function   calls.   It  prints  a  single  character  to  the  display.
  3187.      MPRINTC allows use of ANSI.SYS and similar video drivers, and windowing
  3188.      via  MWINDOW,  but is slower and takes more memory that the usual PRINT
  3189.      statement.
  3190.  
  3191.      Example:
  3192.           CALL MPRINTC(CH$,COL%,ROW%): LOCATE ROW%,COL%
  3193.  
  3194.  
  3195.  
  3196.  
  3197.      Name: MPRINT
  3198.  
  3199.      Type: Video / BIOS
  3200.  
  3201.      Description:
  3202.           Same  as  MPRINTC  (q.v.),  only  it  allows you to send an entire
  3203.      string out to the display, rather than just a single character.
  3204.  
  3205.      Example:
  3206.           CALL MPRINT(ST$,COL%,ROW%): LOCATE ROW%,COL%
  3207.  
  3208.  
  3209.  
  3210.  
  3211.  
  3212.  
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  
  3239.  
  3240.  
  3241.  
  3242.  
  3243.  
  3244.  
  3245.      Name: MULTIAND
  3246.  
  3247.      Type: String / ANY
  3248.  
  3249.      Description:
  3250.           This is a flexible function with many possible uses.  Every charac-
  3251.      ter  in  a  given  string  is ANDed with a value you supply.  One thing
  3252.      this  could  be  used for is translating Wordstar files to ASCII files,
  3253.      by  using  a bit mask (the value that will be ANDed with the character)
  3254.      of  &H7F,  which strips off the high bit of each character.  The string
  3255.      may  be  any length; the bit mask is an integer, with only the low byte
  3256.      in use (value of 0-255).
  3257.  
  3258.      Example:
  3259.           ST$ = ""
  3260.           FOR X%=65 TO 70: ST$=CHR$(X%)+CHR$(X%+128): NEXT
  3261.           PRINT ST$
  3262.           BITMASK%=&H7F
  3263.           CALL MULTIAND(ST$,BITMASK%)
  3264.           PRINT ST$
  3265.  
  3266.  
  3267.  
  3268.  
  3269.      Name: MULTIOR
  3270.  
  3271.      Type: String / ANY
  3272.  
  3273.      Description:
  3274.           Does  the  exact  opposite  of MULTIAND-- instead of stripping off
  3275.      bits,  it  turns  on  bits.   It ORs instead of ANDs.  One possible use
  3276.      for  this would be to encode a text string by ORing with 128, and later
  3277.      decoding  by  ANDing with 128.  This would allow you to save the string
  3278.      to  disk  using  text files, even if the string included control codes,
  3279.      although  that  won't  work right if the string has graphics characters
  3280.      (using  ExtASCII codes, which are codes from 128-255) in it.  The para-
  3281.      meters are the same as for MULTIAND.
  3282.  
  3283.      Example:
  3284.           ST$ = "ABCDE": PRINT ST$
  3285.           SETBITS%=&H80
  3286.           CALL MULTIOR(ST$,SETBITS%)
  3287.           PRINT ST$
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306.  
  3307.  
  3308.  
  3309.  
  3310.  
  3311.      Name: MULTIXOR
  3312.  
  3313.      Type: String / ANY
  3314.  
  3315.      Description:
  3316.           An  exclusive-or  operation  for strings.  Bits in the string will
  3317.      be  set  only  if they are set in the string byte or mask byte, but not
  3318.      in  both  of them.  Note that this can be used as a "MULTINOT" function
  3319.      by  using  a  mask  of  &HFF or 255.  In this case, all bits are set in
  3320.      the  mask, so the result of the XOR will be the same as a NOT operation
  3321.      on  the  string.   Note  that XORing a string with the same value twice
  3322.      will  return  the  original  string-- it can thus be used to encode and
  3323.      decode strings.
  3324.  
  3325.      Example:
  3326.           CALL MULTIXOR(ST$,MASK%)
  3327.  
  3328.  
  3329.  
  3330.  
  3331.      Name: MWINDOW
  3332.  
  3333.      Type: Video / BIOS
  3334.  
  3335.      Description:
  3336.           Sets  up  a  window  for the MPRINT and MPRINTC routines.  Windows
  3337.      are  defined  by  their  upper left corner and lower right corner.  The
  3338.      default  window  is  thus (1,1,80,24), which leaves out the bottom line
  3339.      (BASIC's  status  line).   To  use  the  full screen, call this routine
  3340.      with  values  (1,1,80,25).   Note  that the cursor should be positioned
  3341.      inside  the window before using MPRINT/MPRINTC.  Note also that windows
  3342.      should be defined to contain at least two rows.
  3343.  
  3344.      Example:
  3345.           LFCOL%=20: TOPROW%=5: RTCOL%=60: BOTROW%=15
  3346.           CALL MWINDOW(LFCOL%,TOPROW%,RTCOL%,BOTROW%)
  3347.           LOCATE TOPROW%,LFCOL%
  3348.           REM  sets up a window (of 40 cols x 10 rows)
  3349.           REM  in the middle of the screen.
  3350.  
  3351.  
  3352.  
  3353.  
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370.  
  3371.  
  3372.  
  3373.  
  3374.  
  3375.  
  3376.  
  3377.      Name: PRINTSCREEN
  3378.  
  3379.      Type: Miscellaneous / BIOS
  3380.  
  3381.      Description:
  3382.           This  sends  an  image  of  the  current screen display out to the
  3383.      first  printer  device.   It  works  exactly in the same way as doing a
  3384.      Shift-PrtSc  from  the  keyboard,  so  it  can display graphics as well
  3385.      as text if you have the DOS GRAPHICS program installed.
  3386.  
  3387.  
  3388.  
  3389.  
  3390.      Name: PUTSCREEN
  3391.  
  3392.      Type: Video / CLONE
  3393.  
  3394.      Description:
  3395.           This  restores  an  area  of  the  screen that was saved using the
  3396.      GETSCREEN  function  (q.v.).   You need not restore an area to the same
  3397.      screen coordinates or to the same display page.
  3398.           It  is  possible  to  change  the shape of an area by changing the
  3399.      coordinates  specified.   For  instance,  suppose  you  had saved a six
  3400.      character,  one  line  message,  "FOOBAR",  at coordinates (1,1)-(1,6).
  3401.      You  could  restore it as a three char by two line message, "FOO" "BAR"
  3402.      by specifying the coordinates (1,1)-(2,3).  Note that these coordinates
  3403.      are  in Microsoft's mixed up form of (ROW,COLUMN), not the normal alge-
  3404.      braic format.
  3405.           It  is  also  possible to restore only part of the screen that was
  3406.      saved.   For  instance,  suppose  you had saved the entire screen in an
  3407.      array SCRN starting at element 0, and only wanted to restore the bottom
  3408.      half  of  the  screen.  Using the calculation for screen elements given
  3409.      in  GETSCREEN,  you  would  find that 2000 elements were needed for the
  3410.      whole  screen, or only 1000 elements for the bottom half of the screen.
  3411.      That  means  that  in  the  array,  elements 0-999 hold the top half of
  3412.      the  screen,  and  1000-1999  hold  the bottom half (assuming a default
  3413.      OPTION  BASE=0).   So,  you  would  tell  PUTSCREEN to start with array
  3414.      element  SCRN%(1000),  and  give it the starting and ending coordinates
  3415.      of the corners of the lower half of the screen.
  3416.           Parameters specifications are the same as they are for GETSCREEN.
  3417.  
  3418.      Example:
  3419.      CALL PUTSCREEN(SCRN%(0),TOPROW%,LFCOL%,BOTROW%,RTCOL%,PAGE%,SCRNMODE%)
  3420.  
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427.  
  3428.  
  3429.  
  3430.  
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436.  
  3437.  
  3438.  
  3439.  
  3440.  
  3441.  
  3442.  
  3443.      Name: QPRINT
  3444.  
  3445.      Type: Video / CLONE
  3446.  
  3447.      Description:
  3448.           This  function  bypasses  the  usual  video routines, and prints a
  3449.      string directly on the screen, at a -much- higher speed than the normal
  3450.      PRINT  statement  does.   It also contains a built-in LOCATE statement,
  3451.      and  doesn't  affect the cursor position.  Note that control characters
  3452.      will  show  up  as graphics characters instead of having their original
  3453.      functions,  and  the  color/attributes  used  will  be the ones already
  3454.      on  the  screen.   Display  page zero is used with color adapters.  See
  3455.      also XQPRINT.
  3456.  
  3457.      Example:
  3458.           ST$="This is a test of fast screen printing"
  3459.           ROW%=10: COL%=20
  3460.           CALL QPRINT(ST$,ROW%,COL%)
  3461.  
  3462.  
  3463.  
  3464.  
  3465.  
  3466.  
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472.  
  3473.  
  3474.  
  3475.  
  3476.  
  3477.  
  3478.  
  3479.  
  3480.  
  3481.  
  3482.  
  3483.  
  3484.  
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492.  
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502.  
  3503.  
  3504.  
  3505.  
  3506.  
  3507.  
  3508.  
  3509.      Name: READBITF
  3510.  
  3511.      Type: Miscellaneous / ANY
  3512.  
  3513.      Description:
  3514.           Reads  a  word  from  an  array  of arbitrary bit length, given an
  3515.      index.   The  words  in  the  array  may  be made of one to eight bits.
  3516.      Indices  begin  at  zero  and are limited by integer range.  That is up
  3517.      to  &HFFFF,  subject  to  memory constraints-- the index is taken to be
  3518.      an  unsigned integer value.  This function allows very memory-efficient
  3519.      storage  of  arrays  of  numbers,  provided that the numbers are within
  3520.      a  restricted  range.   The  simulated  array  is  held within a normal
  3521.      integer  array,  which  must  be  dimensioned  large enough to hold all
  3522.      of  the arbitrary-length words (will depend on bits per word and number
  3523.      of words desired).
  3524.  
  3525.      Example:
  3526.           OPTION BASE 0: DIM INTARRAY%(50): BITFSIZE%=8
  3527.             .
  3528.             .
  3529.           ARRAYLOC%=VARPTR(INTARRAY%(0))
  3530.           CALL READBITF(ARRAYLOC%,NDX%,BITFSIZE%,VALUE%)
  3531.           REM  Returns a value from the array location indexed by NDX%,
  3532.           REM  where the array is composed of bytes (8-bit words).
  3533.           REM  See the disk file BITFTEST.BAS in the source files
  3534.           REM  for a working example program.
  3535.  
  3536.  
  3537.  
  3538.  
  3539.      Name: RECOLOR
  3540.  
  3541.      Type: Video / CLONE
  3542.  
  3543.      Description:
  3544.           Takes everything on the screen that's of a given color and changes
  3545.      its  color to whatever you like.  This can be used for special effects,
  3546.      or  just to change the screen color without having to clear the screen.
  3547.      This will work only in text mode.  The color attributes must be defined
  3548.      from the foreground and background colors using the CALCATTR routine.
  3549.  
  3550.      Example:
  3551.           CALL CALCATTR(FOREGND%,BACKGND%,OLDCOLR%)
  3552.           CALL CALCATTR(NEWFORE%,NEWBACK%,NEWCOLR%)
  3553.           CALL RECOLOR(OLDCOLR%,NEWCOLR%)
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.  
  3572.  
  3573.  
  3574.  
  3575.      Name: RENAME
  3576.  
  3577.      Type: Disk / DOS
  3578.  
  3579.      Description:
  3580.           Renames  a  file.   You  cannot  rename across disks (both the old
  3581.      and  the  new  file  must  be on the same disk).  You can rename across
  3582.      subdirectories,  effectively  moving  a  file  to  a  new subdirectory.
  3583.      Since  this  function  returns  an error code rather than using BASIC's
  3584.      error trapping, you can use it within subprograms.
  3585.  
  3586.      Example:
  3587.           OLDFILE$="\MISC\ABC.TXT"+CHR$(0)
  3588.           NEWFILE$="\JUNK\TEST.TXT"+CHR$(0)
  3589.           CALL RENAME(OLDFILE$,NEWFILE$,ERRCODE%)
  3590.           IF ERRCODE% THEN couldn't rename it ELSE renamed
  3591.  
  3592.  
  3593.  
  3594.  
  3595.      Name: RESETPOINT
  3596.  
  3597.      Type: Video / BIOS
  3598.  
  3599.      Description:
  3600.           Resets a point on a text screen.  This is the opposite of SETPOINT
  3601.      (see).
  3602.  
  3603.      Example:
  3604.           ROW%=0
  3605.           FOR COLUMN%=0 to 79
  3606.              CALL RESETPOINT(COLUMN%,ROW%)
  3607.           NEXT COLUMN%
  3608.           REM  this clears a line from the top of the screen
  3609.           REM  (undoes the line from the SETPOINT example)
  3610.  
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.  
  3635.  
  3636.  
  3637.  
  3638.  
  3639.  
  3640.  
  3641.      Name: REVERSE
  3642.  
  3643.      Type: String / ANY
  3644.  
  3645.      Description:
  3646.           Reverses  the  order  of  characters  in  a  string.   This can be
  3647.      combined with the XLATE function and a judiciously-designed translation
  3648.      table  to provide mirror images of strings for character-graphics-based
  3649.      displays.   It  can also be used with INSTR to provide a function which
  3650.      returns the last occurrence of a given substring within a string.
  3651.  
  3652.      Example:
  3653.           MSG$="This is a test"
  3654.           CALL REVERSE(MSG$)
  3655.           PRINT MSG$
  3656.  
  3657.  
  3658.  
  3659.  
  3660.      Name: RROTATE
  3661.  
  3662.      Type: String / ANY
  3663.  
  3664.      Description:
  3665.           Rotates  the  characters  in  a string right.  This is the same as
  3666.      LROTATE, only in reverse.  See LROTATE for further details.
  3667.  
  3668.      Example:
  3669.           ST$="12345"
  3670.           CALL RROTATE(ST$)
  3671.           REM  ST$ will end up being "51234"
  3672.  
  3673.  
  3674.  
  3675.  
  3676.  
  3677.  
  3678.  
  3679.  
  3680.  
  3681.  
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692.  
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700.  
  3701.  
  3702.  
  3703.  
  3704.  
  3705.  
  3706.  
  3707.      Name: SCROLL
  3708.  
  3709.      Type: Video / BIOS
  3710.  
  3711.      Description:
  3712.           Scrolls  any  selected  portion of the screen as many times as you
  3713.      like
  3714.      (or  use  0 to clear that part of the screen entirely).  There are five
  3715.      parameters  to  this  function: coordinates (LFCOL,TOPROW) of the upper
  3716.      left  corner  of  the  area  to be scrolled, coordinates (RTCOL,BOTROW)
  3717.      of  the  lower  right corner of the area to be scrolled, and the number
  3718.      of  times  to scroll the area.  This routine may be used to create win-
  3719.      dows.   Note  that  RTCOL  must  be at least one greater than LFCOL (no
  3720.      single-line  scrolling,  obviously).   Note  also  that  you should not
  3721.      try  to  scroll  more  times  than  there  are  lines in the area to be
  3722.      scrolled  (use  0  instead).  Parameters are not checked, so be careful
  3723.      not to use illegal screen coordinates.
  3724.  
  3725.      Example:
  3726.           CALL SCROLL(LFCOL%,TOPROW%,RTCOL%,BOTROW%,NUMLINES%)
  3727.  
  3728.  
  3729.  
  3730.  
  3731.  
  3732.  
  3733.  
  3734.  
  3735.  
  3736.  
  3737.  
  3738.  
  3739.  
  3740.  
  3741.  
  3742.  
  3743.  
  3744.  
  3745.  
  3746.  
  3747.  
  3748.  
  3749.  
  3750.  
  3751.  
  3752.  
  3753.  
  3754.  
  3755.  
  3756.  
  3757.  
  3758.  
  3759.  
  3760.  
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766.  
  3767.  
  3768.  
  3769.  
  3770.  
  3771.  
  3772.  
  3773.      Name: SCRREST
  3774.  
  3775.      Type: Video / CLONE
  3776.  
  3777.      Description:
  3778.           Restores  the  screen  display  from an image put into an array by
  3779.      SCRSAVE.  Same requirements and limitations of SCRSAVE.
  3780.  
  3781.      Example:
  3782.           WHERE%=VARPTR(SCR%(1))
  3783.           CALL SCRREST(WHERE%)
  3784.           LOCATE OLDROW%,OLDCOL%
  3785.  
  3786.  
  3787.  
  3788.  
  3789.      Name: SCRSAVE
  3790.  
  3791.      Type: Video / CLONE
  3792.  
  3793.      Description:
  3794.           Stores  the  current  screen  display  (page  0 only) in an array.
  3795.      Text  modes  only.   Requires  an  array  of 4000 bytes, and an integer
  3796.      which  points  to  the  location  of the array.  The cursor position is
  3797.      not saved.
  3798.  
  3799.      Example:
  3800.           OPTION BASE 1: DIM SCR%(2000)
  3801.            .
  3802.            .
  3803.           WHERE%=VARPTR(SCR%(1))
  3804.           CALL SCRSAVE(WHERE%)
  3805.           OLDCOL%=POS(0): OLDROW%=CSRLIN
  3806.           REM  Dim of 2000 w/ option base 1 gives us 2000 integers,
  3807.           REM  which gives us 4000 bytes of storage space.
  3808.           REM  Note: you can store more than one screen in an array by
  3809.           REM  dimensioning it large enough.  Use WHERE%=VARPTR(SCR%(2001))
  3810.           REM  to locate the second screen, and so forth.
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.  
  3836.  
  3837.  
  3838.  
  3839.      Name: SCRRESTP, SCRRESTPD, SCRSAVEP, SCRSAVEPD
  3840.  
  3841.      Type: Video / CLONE
  3842.  
  3843.      Description:
  3844.           These  functions  are  variations  of SCRREST and SCRSAVE.  All of
  3845.      them  allow  specification  of a page number, for color monitors.  They
  3846.      will  save  or restore text to a given page.  When used with monochrome
  3847.      monitors,  the  page  specification  should  always be zero.  SCRRESTPD
  3848.      and  SCRSAVEPD  write  directly to the screen at high speed.  This will
  3849.      cause  "snow"  if  you  have  an  old  or poorly designed color display
  3850.      adapter  and  are  writing  to  the  active  screen  page.  Under those
  3851.      conditions, you should use SCRRESTP/SCRSAVEP or SCRREST/SCRSAVE.
  3852.  
  3853.      Example:
  3854.           WHERE%=VARPTR(SCR%(1)): SCRNPAGE%=0
  3855.           CALL SCRRESTP(WHERE%,SCRNPAGE%): LOCATE OLDROW%,OLDCOL%
  3856.  
  3857.  
  3858.  
  3859.  
  3860.  
  3861.  
  3862.  
  3863.  
  3864.  
  3865.  
  3866.  
  3867.  
  3868.  
  3869.  
  3870.  
  3871.  
  3872.  
  3873.  
  3874.  
  3875.  
  3876.  
  3877.  
  3878.  
  3879.  
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.  
  3901.  
  3902.  
  3903.  
  3904.  
  3905.      Name: SETCOMM
  3906.  
  3907.      Type: Miscellaneous / CLONE
  3908.  
  3909.      Description:
  3910.           Sets   communications   parameters  on  an  opened  communications
  3911.      device.  This allows you to set the baud rate higher than BASIC normal-
  3912.      ly  allows,  and  to change the comm parameters without having to close
  3913.      the comm device.
  3914.           Why  is  it  bad  to  have to close the comm device?  Because that
  3915.      will  make  the  DTR  signal drop, which will cause many modems to drop
  3916.      the  carrier and lose your connection.  In fact, for Hayes-type modems,
  3917.      that's  a  much  more reliable way to end communications than using the
  3918.      ATH "hang up modem" command.
  3919.           If  you  try  to  set  a  comm port which does not exist, the port
  3920.      number  will  be set to zero after the call.  If you give illegal para-
  3921.      meters  elsewhere,  the port will be set to a default of 300 baud, Even
  3922.      parity,  Seven-bit  words,  and  One  stop  bit (any of the parms which
  3923.      were legal will be used).
  3924.  
  3925.      Example:
  3926.           OPEN"R",1,"COM1:300,E,7,1,RS,CS,DS"
  3927.           COMMPORT%=1: BPS%=6: PARITY%=0: WORDLENGTH%=8
  3928.           STOPBITS%=1
  3929.           CALL SETCOMM(COMMPORT%,BPS%,PARITY%,WORDLENGTH%,STOPBITS%)
  3930.           REM  sets the port to 19200 baud, No parity, 8 bit words
  3931.           REM  and 1 stop bit.
  3932.  
  3933.      Settings:
  3934.           COMMPORT% may be 1 - 2, and will be returned as 0 if the specified
  3935.      port doesn't exist.
  3936.           BPS%  ("baud  rate")  is  specified  by  a number from 0 - 7.  Use
  3937.      0  for  300  bps,  1 for 600, 2 for 1200, 3 for 2400, 4 for 4800, 5 for
  3938.      9600,  6  for  19200,  and  7  for 38400 bps.  Whether you can actually
  3939.      get speeds over 9600 will depend on the quality of your comm port.
  3940.           PARITY% is a number 0-2.  Use 0 for None, 1 for Odd, 2 for Even.
  3941.           WORDLENGTH% may be 7 or 8.
  3942.           STOPBITS% may be 1 or 2.
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964.  
  3965.  
  3966.  
  3967.  
  3968.  
  3969.  
  3970.  
  3971.      Name: SETDRV
  3972.  
  3973.      Type: Disk / DOS
  3974.  
  3975.      Description:
  3976.           Sets  the  default  drive.   The drive string must be at least one
  3977.      character long, and start with a letter specifying a disk drive.
  3978.  
  3979.      Example:
  3980.           DRV$="B:"
  3981.             .
  3982.             .
  3983.           CALL SETDRV(DRV$)
  3984.  
  3985.  
  3986.  
  3987.  
  3988.      Name: SETFATTR
  3989.  
  3990.      Type: Disk / DOS
  3991.  
  3992.      Description:
  3993.           Sets  the attribute of a file.  See the section on file attributes
  3994.      at the end of this manual.
  3995.  
  3996.      Example:
  3997.           FIL$=FIL$+CHR$(0)
  3998.           CALL SETFATTR(FIL$,ATTR%)
  3999.  
  4000.  
  4001.  
  4002.  
  4003.      Name: SETFTD
  4004.  
  4005.      Type: Disk / DOS
  4006.  
  4007.      Description:
  4008.           Sets  file  time/date stamp.  The filename must be terminated with
  4009.      a  NUL  character.   The  year  may be either a four digit or two digit
  4010.      number  (e.g.,  either  1986  or  just 86).  DOS will round the seconds
  4011.      value  off  to  the next lower even number.  If there is a problem with
  4012.      the  filename,  the  month  will be returned as -1.  Note that midnight
  4013.      is 24:00, not 00:00 (which tells DOS not to display the file's time).
  4014.  
  4015.      Example:
  4016.           FIL$=FIL$+CHR$(0)
  4017.           CALL SETFTD(FIL$,MONTH%,DAY%,YEAR%,HOUR%,MINUTE%,SECOND%)
  4018.           IF MONTH%=-1 THEN PRINT "No such file"
  4019.  
  4020.  
  4021.  
  4022.  
  4023.  
  4024.  
  4025.  
  4026.  
  4027.  
  4028.  
  4029.  
  4030.  
  4031.  
  4032.  
  4033.  
  4034.  
  4035.  
  4036.  
  4037.      Name: SETMATI
  4038.  
  4039.      Type: Miscellaneous / ANY
  4040.  
  4041.      Description:
  4042.           Sets  the  first  SIZ%  elements  of  an  integer array to a given
  4043.      (scalar)  value,  INITVAL%.   It will work on multi-dimensional arrays,
  4044.      in  which  case  the leftmost dimension increments first (unless you've
  4045.      set  the  compiler  option  telling  it to do otherwise).  See examples
  4046.      for clarification.
  4047.  
  4048.      Example:
  4049.           OPTION BASE 0: DIM BANANA%(9)
  4050.           SIZ%=10: INITVAL%=-3: ARLOC%=VARPTR(BANANA%(0))
  4051.           CALL SETMATI(ARLOC%,SIZ%,INITVAL%)
  4052.           REM  we have just initialized all 10 elements of the array to
  4053.           REM  the value -3.
  4054.  
  4055.      Example:
  4056.           OPTION BASE 1: DIM FOO%(3,5)
  4057.           SIZ%=5: INITVAL%=20000: ARLOC%=VARPTR(FOO%(1,1))
  4058.           CALL SETMATI(ARLOC%,SIZ%,INITVAL%)
  4059.           REM  we have just set the first five elements of the array to
  4060.           REM  20000.  The first five elements are FOO%(1,1), FOO%(2,1),
  4061.           REM  FOO%(3,1), FOO%(1,2), FOO%(2,2).  If you want to initialize
  4062.           REM  the whole array to 20000, set SIZ%=3*5 for OPTION BASE 1
  4063.           REM  or SIZ%=(3+1)*(5+1) for OPTION BASE 0.
  4064.           REM  By changing the first element (in the ARLOC% assignment), you
  4065.           REM  can set any part of the array, not just the first elements.
  4066.           REM  See SCRSAVE/SCRREST if you need to clear up that last point.
  4067.  
  4068.  
  4069.  
  4070.  
  4071.  
  4072.  
  4073.  
  4074.  
  4075.  
  4076.  
  4077.  
  4078.  
  4079.  
  4080.  
  4081.  
  4082.  
  4083.  
  4084.  
  4085.  
  4086.  
  4087.  
  4088.  
  4089.  
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096.  
  4097.  
  4098.  
  4099.  
  4100.  
  4101.  
  4102.  
  4103.      Name: SETKBD
  4104.  
  4105.      Type: Input / CLONE
  4106.  
  4107.      Description:
  4108.           Sets  the  status  of  the keyboard toggles.  The toggle is set on
  4109.      if  the  value  is  nonzero,  and off if the value is zero.  Good style
  4110.      suggests  that,  before  using  this  function  for the first time, you
  4111.      should  get  the  toggles  with GETKBD (see) and save them.  You should
  4112.      then  restore  the  keyboard  to that original state before exiting the
  4113.      program.
  4114.  
  4115.      Example:
  4116.           REM  Let's turn off Insert, Caps Lock, and Scroll Lock
  4117.           REM  and put the keypad into numeric mode by turning on Num Lock
  4118.           INSERT%=0: CAPSLOCK%=0: NUMLOCK%=1: SCROLLLOCK%=0
  4119.           CALL SETKBD(INSERT%,CAPSLOCK%,NUMLOCK%,SCROLLLOCK%)
  4120.  
  4121.  
  4122.  
  4123.  
  4124.      Name: SETPOINT
  4125.  
  4126.      Type: Video / BIOS
  4127.  
  4128.      Description:
  4129.           Sets  a  point  on  a  text  screen.   This  allows low-resolution
  4130.      graphics  on  monochrome  as  well  as color monitors.  Normal text can
  4131.      also  be  mixed  with  the graphics.  Resolution is 80x50 (0-79 columns
  4132.      by 0-49 rows).  See also RESETPOINT and TESTPOINT.
  4133.  
  4134.      Example:
  4135.           ROW%=24
  4136.           FOR COLUMN%=0 TO 79
  4137.              CALL SETPOINT(COLUMN%,ROW%)
  4138.           NEXT COLUMN%
  4139.           REM  this draws a line across the middle of the screen.
  4140.  
  4141.  
  4142.  
  4143.  
  4144.      Name: SETSUB
  4145.  
  4146.      Type: Disk / DOS
  4147.  
  4148.      Description:
  4149.           Sets  the  default  subdirectory.   The  subdirectory  string must
  4150.      be  terminated  by  a  NUL character.  An error will be returned if the
  4151.      specified subdirectory doesn't exist.
  4152.  
  4153.      Example:
  4154.           TMP$=SUB$+CHR$(0): CALL SETSUB(TMP$,ERRCODE%)
  4155.           IF ERRCODE% THEN bad subdir ELSE new default subdir selected
  4156.  
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.  
  4166.  
  4167.  
  4168.  
  4169.      Name: SHIFTL
  4170.  
  4171.      Type: Miscellaneous / ANY
  4172.  
  4173.      Description:
  4174.           Shifts all the bits in an integer left COUNT times, putting zeroes
  4175.      in  the bit positions which have been vacated.  This effectively multi-
  4176.      plies  the  value  by  a power of two in most instances.  This function
  4177.      is  included  for  those  advanced  programmers who know what it's good
  4178.      for...
  4179.  
  4180.      Example:
  4181.           VALUE%=47: COUNT%=3
  4182.           CALL SHIFTL(VALUE%,COUNT%)
  4183.           REM  we just shifted VALUE% left three bits
  4184.           REM  (in this case getting 47 * 2^3, or 376)
  4185.  
  4186.  
  4187.  
  4188.  
  4189.      Name: SHIFTR
  4190.  
  4191.      Type: Miscellaneous / ANY
  4192.  
  4193.      Description:
  4194.           Same  as  SHIFTL, but shifts the bits right instead of left.  This
  4195.      is similar in effect to an integer divide by a power of two.
  4196.  
  4197.      Example:
  4198.           VALUE%=47: COUNT%=3
  4199.           CALL SHIFTR(VALUE%,COUNT%)
  4200.           REM  we just shifted VALUE% right 3 bits
  4201.           REM  (here getting 47 \ 2^3, or 5)
  4202.  
  4203.  
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.  
  4222.  
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228.  
  4229.  
  4230.  
  4231.  
  4232.  
  4233.  
  4234.  
  4235.      Name: SOUNDEX
  4236.  
  4237.      Type: String / ANY
  4238.  
  4239.      Description:
  4240.           This  routine  returns  the Soundex code for a string you give it.
  4241.      I'm  not sure who invented Soundex, but it's pretty handy.  The Soundex
  4242.      routine  takes  a  word  and returns a string which represents what the
  4243.      word  sounds  like  in  an abstract format.  Similar-sounding words can
  4244.      thus  be  identified  easily  by your program after Soundex processing.
  4245.      This  can  be  useful in applications where a person is not sure of the
  4246.      exact  spelling  of  a  word/name/city,  etc.   To use, put the word in
  4247.      WORD$, initialize the return string SCODE$ to the same length as WORD$,
  4248.      and  execute  the  routine.   SLEN%  will  return  the actual length of
  4249.      SCODE$,  which  may  vary  from zero to the length of WORD$.  If SCODE$
  4250.      is  not  as  long  as  WORD$  when the routine is called, SLEN% will be
  4251.      returned  as  -1  to  flag  an  error.  The Soundex code is returned as
  4252.      a  series  of  digits  in  SCODE$,  although you can represent this any
  4253.      way you choose in your program.
  4254.  
  4255.      Example:
  4256.           WORD$="AnyWord": SCODE$=WORD$
  4257.           CALL SOUNDEX(WORD$,SCODE$,SLEN%)
  4258.           PRINT"The Soundex code for ";WORD$;" is ";LEFT$(SCODE$,SLEN%);"."
  4259.           REM  Try this routine a few times to get a feel for it.
  4260.  
  4261.  
  4262.  
  4263.  
  4264.      Name: SPEAKER
  4265.  
  4266.      Type: Miscellaneous / CLONE
  4267.  
  4268.      Description:
  4269.           This  function  allows  you  to  turn the speaker on or off.  This
  4270.      allows you to disable sound effects for a program.  Your sound routines
  4271.      will  still  be  executed,  but  will not produce any sound if you have
  4272.      turned  the  speaker off.  Thus, your routines will execute at the same
  4273.      speed  whether  or  not  sound is turned on, and the timing will remain
  4274.      the same.  Note that you should turn the speaker back on before exiting
  4275.      the program!
  4276.           Use zero to turn off the speaker, nonzero to turn it back on.
  4277.           NOTE: This  function  appears  to be erratic, especially when used
  4278.      with  slightly  incompatible  machines  such as the AT.  It is unlikely
  4279.      to work on a PCjr.  Test it to see if it works for you.
  4280.  
  4281.      Example:
  4282.           SPKR% = 0
  4283.           CALL SPEAKER(SPKR%)
  4284.           REM  turn the speaker off
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297.  
  4298.  
  4299.  
  4300.  
  4301.      Name: STRIP
  4302.  
  4303.      Type: String / ANY
  4304.  
  4305.      Description:
  4306.           Strips  all  occurrences  of a given target character from a given
  4307.      source  string.   The  target  string must be at least one character in
  4308.      length (if more, the first character will be used).
  4309.  
  4310.      Example:
  4311.           MSG$="12 - 2 =   10"
  4312.             .
  4313.             .
  4314.           CH$=" ": CALL STRIP(MSG$,CH$,MLEN%): MSG$=LEFT$(MSG$,MLEN%)
  4315.  
  4316.  
  4317.  
  4318.  
  4319.      Name: STRIPBLANKS
  4320.  
  4321.      Type: String / ANY
  4322.  
  4323.      Description:
  4324.           Strips  blanks  (and  control  characters) from either the left or
  4325.      right  side of a string, or both sides.  Specify 0 (zero) for no strip,
  4326.      1 to strip left, 2 to strip right, or 3 to strip both sides.
  4327.  
  4328.      Example:
  4329.           STRIPWHICH=3: REM strip both sides of blanks
  4330.           CALL STRIPBLANKS(ST$,STRIPWHICH%,SLEN%)
  4331.           ST$=LEFT$(ST$,SLEN%)
  4332.  
  4333.  
  4334.  
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356.  
  4357.  
  4358.  
  4359.  
  4360.  
  4361.  
  4362.  
  4363.  
  4364.  
  4365.  
  4366.  
  4367.      Name: STRIPRANGE
  4368.  
  4369.      Type: String / ANY
  4370.  
  4371.      Description:
  4372.           Strips all characters within a given range out of a source string.
  4373.  
  4374.      Example:
  4375.           MSG$="ALL uppercase letters will be G-O-N-E gone"
  4376.           LO%=ASC("A"): HI%=ASC("Z")
  4377.           CALL STRIPRANGE(MSG$,LO%,HI%,MLEN%)
  4378.           MSG$=LEFT$(MSG$,MLEN%)
  4379.  
  4380.  
  4381.  
  4382.  
  4383.      Name: SUBEXIST
  4384.  
  4385.      Type: Disk / DOS
  4386.  
  4387.      Description:
  4388.           Tests  to  see  if  a  given subdirectory exists.  You may include
  4389.      a  drive  spec  in  the  subdirectory name, which must be terminated by
  4390.      a null.
  4391.  
  4392.      Example:
  4393.           SUBDIR$="C:\TEMP"+CHR$(0)
  4394.           CALL SUBEXIST(SUBDIR$,VALID%)
  4395.           IF VALID% THEN PRINT"Subdirectory exists"
  4396.           ELSE PRINT"No such subdirectory"
  4397.  
  4398.  
  4399.  
  4400.  
  4401.  
  4402.  
  4403.  
  4404.  
  4405.  
  4406.  
  4407.  
  4408.  
  4409.  
  4410.  
  4411.  
  4412.  
  4413.  
  4414.  
  4415.  
  4416.  
  4417.  
  4418.  
  4419.  
  4420.  
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426.  
  4427.  
  4428.  
  4429.  
  4430.  
  4431.  
  4432.  
  4433.      Name: TESTPOINT
  4434.  
  4435.      Type: Video / BIOS
  4436.  
  4437.      Description:
  4438.           Tests  a  pixel  on  a  text  screen to see if it's on or off (see
  4439.      SETPOINT  for  information  about  text  graphics).  The value returned
  4440.      will be set if the point is set, or reset if the point is not set.
  4441.  
  4442.      Example:
  4443.           COL%=39: ROW%=24: REM  check a point near the middle of the screen
  4444.           CALL TESTPOINT(COL%,ROW%,STATUS%)
  4445.           IF STATUS% THEN PRINT"The point is lit"
  4446.           ELSE PRINT"The point is not lit"
  4447.  
  4448.  
  4449.  
  4450.  
  4451.      Name: TIME2INT
  4452.  
  4453.      Type: Miscellaneous / ANY
  4454.  
  4455.      Description:
  4456.           Squeezes  the  time  down to a single integer, for reduced storage
  4457.      requirements.   You  will lose some accuracy in the seconds, which will
  4458.      be  converted  to  an  even  number (odd numbers will be rounded down).
  4459.      To  avoid  ambiguity,  it  is  recommended that you specify hours using
  4460.      a 24-hour clock.  See also INT2TIME.
  4461.  
  4462.      Example:
  4463.           CALL(HOUR%,MIN%,SEC%,SQZTIME%)
  4464.  
  4465.  
  4466.  
  4467.  
  4468.      Name: TIMEN2S
  4469.  
  4470.      Type: String / ANY
  4471.  
  4472.      Description:
  4473.           Converts  the  time  from  numbers to a string.  The string should
  4474.      be at least eight characters long.  See also TIMES2N.
  4475.  
  4476.      Example:
  4477.           HOUR%=13: MIN%=30: SEC%=8: TIM$=SPACE$(8)
  4478.           CALL TIMEN2S(HOUR%,MIN%,SEC%,TIM$)
  4479.           REM  From this, we get TIM$="13:30:08"
  4480.  
  4481.  
  4482.  
  4483.  
  4484.  
  4485.  
  4486.  
  4487.  
  4488.  
  4489.  
  4490.  
  4491.  
  4492.  
  4493.  
  4494.  
  4495.  
  4496.  
  4497.  
  4498.  
  4499.      Name: TIMES2N
  4500.  
  4501.      Type: String / ANY
  4502.  
  4503.      Description:
  4504.           Converts  the  time  from  a  string  to numbers.  The seconds are
  4505.      optional, and will be set to zero if nonexistent.
  4506.  
  4507.      Example:
  4508.           TIM$="13:09:42"
  4509.           CALL TIMES2N(HOUR%,MIN%,SEC%,TIM$)
  4510.           REM  We get HOUR%=13, MIN%=9, SEC%=42
  4511.           TIM$="03:15"
  4512.           CALL TIMES2N(HOUR%,MIN%,SEC%,TIM$)
  4513.           REM  We get HOUR%=3, MIN%=15, SEC%=0
  4514.  
  4515.  
  4516.  
  4517.  
  4518.      Name: TINSTR
  4519.  
  4520.      Type: STRING / ANY
  4521.  
  4522.      Description:
  4523.           Allows  you  to  search  for  a  given  type of character within a
  4524.      string.   You  may  search for any of several character types by adding
  4525.      the  values of the types to search for.  This also allows you to search
  4526.      for  the  opposite  of  a  character type (that is, search for anything
  4527.      other than that type).
  4528.  
  4529.      Character types:
  4530.      1
  4531.           Alphabetic  A-Z, a-z
  4532.      2
  4533.           Numeric     0-9
  4534.      4
  4535.           Symbolic    (anything not covered by other types)
  4536.      8
  4537.           Control     (control codes: ASCII 0-31, 127)
  4538.      16
  4539.           Graphics    (PC graphics codes: 128-255)
  4540.      32
  4541.           Blank       (a blank space, ASCII 32)
  4542.  
  4543.      Example:
  4544.           CHRTYPE%=1+2+4+8+16  : REM search for first non-blank character
  4545.           CALL TINSTR(ST$,CHRTYPE%,PLACE%)
  4546.           IF PLACE%=0 THEN PRINT"The string contains no non-blank chars"
  4547.           ELSE PRINT"The first nonblank character is at location";PLACE%;"."
  4548.  
  4549.      Example:
  4550.           CHRTYPE%=2  : REM search for first numeric character
  4551.           ST$="Springfield, VA 22152"
  4552.           CALL TINSTR(ST$,CHRTYPE%,PLACE%)
  4553.           PRINT"The zip code is: ";MID$(ST$,PLACE%,5)
  4554.  
  4555.  
  4556.  
  4557.  
  4558.  
  4559.  
  4560.  
  4561.  
  4562.  
  4563.  
  4564.  
  4565.  
  4566.  
  4567.  
  4568.  
  4569.  
  4570.  
  4571.      Name: UPCASE
  4572.  
  4573.      Type: String / ANY
  4574.  
  4575.      Description:
  4576.           Converts a string to all uppercase.
  4577.  
  4578.      Example:
  4579.           MSG$="Four score and seven years ago"
  4580.             .
  4581.             .
  4582.           CALL UPCASE(MSG$)
  4583.  
  4584.  
  4585.  
  4586.  
  4587.  
  4588.  
  4589.  
  4590.  
  4591.  
  4592.  
  4593.  
  4594.  
  4595.  
  4596.  
  4597.  
  4598.  
  4599.  
  4600.  
  4601.  
  4602.  
  4603.  
  4604.  
  4605.  
  4606.  
  4607.  
  4608.  
  4609.  
  4610.  
  4611.  
  4612.  
  4613.  
  4614.  
  4615.  
  4616.  
  4617.  
  4618.  
  4619.  
  4620.  
  4621.  
  4622.  
  4623.  
  4624.  
  4625.  
  4626.  
  4627.  
  4628.  
  4629.  
  4630.  
  4631.  
  4632.  
  4633.  
  4634.  
  4635.  
  4636.  
  4637.      Name: WEEKDAY
  4638.  
  4639.      Type: Miscellaneous / DOS
  4640.  
  4641.      Description:
  4642.           Returns  an  integer  from  1  - 7 indicating the day of the week,
  4643.      Sunday  through  Saturday.  The example routine turns this integer into
  4644.      the week day.
  4645.  
  4646.      Example:
  4647.           CALL WEEKDAY(DAY%)
  4648.           DLEN%=VAL(MID$("3346535",DAY%,1))
  4649.           DLOC%=ASC(MID$("ADGKQVY",DAY%))-64
  4650.           REM  The above string MUST be in uppercase!
  4651.           PRINT"Today is";
  4652.           PRINT MID$("SunMonTuesWednesThursFriSatur",DLOC%,DLEN%);"day."
  4653.  
  4654.  
  4655.  
  4656.  
  4657.      Name: WRITEBITF
  4658.  
  4659.      Type: Miscellaneous / ANY
  4660.  
  4661.      Description:
  4662.           Allows  a value to be written into a given location of a simulated
  4663.      array  of  words  of  arbitrary  bit  length (1-8 bits per word).  This
  4664.      goes  with  the  READBITF function above.  The "BITF" is for Bit Field,
  4665.      because  the  functions work by creating fields of arbitrary bit length
  4666.      within what is actually an integer array.
  4667.  
  4668.      Example:
  4669.           CALL WRITEBITF(ARRAYLOC%,INDEX%,BITFSIZE%,VALUE%)
  4670.           REM  See the READBITF function, and see the BITFTEST.BAS if you
  4671.           REM  have the ADVBAS contributor disk, to better idea of what's
  4672.           REM  going on.  This function is not for novice programmers!
  4673.  
  4674.  
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.  
  4694.  
  4695.  
  4696.  
  4697.  
  4698.  
  4699.  
  4700.  
  4701.  
  4702.  
  4703.      Name: XLATE
  4704.  
  4705.      Type: String / ANY
  4706.  
  4707.      Description:
  4708.           This  function  translates a string, character by character, using
  4709.      a  table  you supply.  The character's ASCII value is used as the index
  4710.      to  the  table, and the value at that location replaces the character's
  4711.      current  value.   The  character  may  be  one byte in length, in which
  4712.      case  it  will be translated, or zero bytes, in which case nothing will
  4713.      happen.   The  translation  string  must  be  256 bytes long (remember,
  4714.      strings  may  be  longer  than  255 bytes in Compiled BASIC, so this is
  4715.      ok).
  4716.  
  4717.      Example:
  4718.           XLT$=""
  4719.           FOR X%=0 TO 255: XLT$=XLT$+CHR$(X%): NEXT
  4720.           MID$(XLT$,1,5)="ABCDE": CH$=CHR$(0)
  4721.           CALL XLATE(CH$,XLT$)
  4722.           PRINT CH$
  4723.           REM  CH$ ends up "A", since the start of the table + zero bytes
  4724.           REM      contains "A".  We add zero bytes, because CH$ was
  4725.           REM      originally equal to CHR$(0).
  4726.  
  4727.  
  4728.  
  4729.  
  4730.      Name: XMPRINT
  4731.  
  4732.      Type: Video / BIOS
  4733.  
  4734.      Description:
  4735.           This  routine  combines the XLATE and MPRINTC functions.  It takes
  4736.      a  character,  runs  it  through  a translation table, and prints it to
  4737.      the  screen  unless  the translated value is NUL (ASCII zero).  If it's
  4738.      NUL,  no  printing  takes  place.   MS-DOS calls are used for printing,
  4739.      so  ANSI.SYS will work.  See the XLATE and MPRINTC routines for further
  4740.      information.
  4741.  
  4742.      Example:
  4743.           CALL XMPRINT(CH$,XLATE$,COL%,ROW%): LOCATE ROW%,COL%
  4744.  
  4745.  
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755.  
  4756.  
  4757.  
  4758.  
  4759.  
  4760.  
  4761.  
  4762.  
  4763.  
  4764.  
  4765.  
  4766.  
  4767.  
  4768.  
  4769.      Name: XQPRINT
  4770.  
  4771.      Type: Video / CLONE
  4772.  
  4773.      Description:
  4774.           This  function  is  an  extended  version  of  QPRINT.  It is more
  4775.      flexible,  and  only  a trifle slower.  XQPRINT has two advantages over
  4776.      QPRINT: it  allows  you  to  choose  a color/attribute to use, and lets
  4777.      you  choose  a  display  page  (color/graphics  adapters  only!).   The
  4778.      attribute  ATTR  must  be  set up using the CALCATTR routine.  The page
  4779.      argument is ignored for monochrome adapters.
  4780.  
  4781.      Example:
  4782.           ST$="This is a test of fast screen printing"
  4783.           ROW%=10: COL%=20: PAGE%=0
  4784.           CALL CALCATTR(FOREGND%,BACKGND%,ATTR%)
  4785.           CALL XQPRINT(ST$,ROW%,COL%,ATTR%,PAGE%)
  4786.  
  4787.  
  4788.  
  4789.  
  4790.      Name: XQPRINTD
  4791.  
  4792.      Type: Video / CLONE
  4793.  
  4794.      Description:
  4795.           This  function  is  identical  to  XQPRINT, with the one exception
  4796.      that  it  writes  directly  to  the  screen.  That makes it even faster
  4797.      than  XQPRINT, but means that it will cause snow on some color monitors
  4798.      when printing to the active display page.
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.  
  4805.  
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.  
  4813.  
  4814.  
  4815.  
  4816.  
  4817.  
  4818.  
  4819.  
  4820.  
  4821.  
  4822.  
  4823.  
  4824.  
  4825.  
  4826.  
  4827.  
  4828.  
  4829.  
  4830.  
  4831.  
  4832.  
  4833.  
  4834.  
  4835.                                  File Attributes
  4836.  
  4837.  
  4838.  
  4839.  
  4840.           Every  file  has  an  "attribute byte" which tells something about
  4841.      the  file.   This  can  be  modified to some extent.  For instance, any
  4842.      file  can  be  made  "hidden", in which case it will be invisible; this
  4843.      includes  subdirectories,  which  can  still  be used even if you can't
  4844.      see  that  they're there.  Some kinds of changes are not possible, how-
  4845.      ever: you can't change a subdirectory into a normal file, for example.
  4846.  
  4847.  
  4848.      Attribute      Code      Description
  4849.  
  4850.      Normal         00h       A normal file.
  4851.      Read-only      01h       File can't be killed or rewritten.
  4852.      Hidden         02h       File disappears from view.
  4853.      System         04h       Like HIDDEN.  For system (DOS, BIOS) files.
  4854.      Volume label   08h       A disk's volume label.  Only one, in the root.
  4855.      Directory      10h       Subdirectory.
  4856.      Archive        20h       Usually set.  May be used for disk backup.
  4857.  
  4858.  
  4859.           Combinations  of  the  codes are possible, as I've mentioned.  For
  4860.      instance,  a  hidden subdirectory would have a code of 10h + 02h = 12h.
  4861.      A  normal  file,  because  of  the archive bit, might show up as either
  4862.      00h  or  20h... and  so on.  Note this is all in hexadecimal, hence the
  4863.      "h"  postfix.   Convert  to  decimal  form  as  necessary  when calling
  4864.      routines  which  use the file attribute.  BASIC has functions to handle
  4865.      this  for  you  if you don't understand hex-- see the HEX$ function and
  4866.      &H prefix in your BASIC manual.
  4867.  
  4868.           NOTE: Reading  the  volume  label is unreliable in versions of DOS
  4869.      prior to MS-DOS 3.1, due to a DOS bug.  The most secure way of handling
  4870.      it  is to do a search with the label attribute (8), then to doublecheck
  4871.      the  actual  attribute  of  the  file  (if any) which was returned.  If
  4872.      it's not the volume label, use FINDNEXTF and try again.
  4873.  
  4874.  
  4875.  
  4876.  
  4877.  
  4878.  
  4879.  
  4880.  
  4881.  
  4882.  
  4883.  
  4884.  
  4885.  
  4886.  
  4887.  
  4888.  
  4889.  
  4890.  
  4891.  
  4892.  
  4893.  
  4894.  
  4895.  
  4896.  
  4897.  
  4898.  
  4899.  
  4900.  
  4901.                               New file I/O routines
  4902.  
  4903.  
  4904.  
  4905.           This  contains  some  general  information  about the new file I/O
  4906.      routines:  FCLOSE, FCREATE, FOPEN, FREAD, FSETEND, FSETREC, and FWRITE.
  4907.  
  4908.           These  routines  duplicate  a  number  of  extant BASIC functions.
  4909.      They  are  useful,  however, for a number of reasons.  They provide you
  4910.      with  low-level  control  over  the  details  of file input and output.
  4911.      They  may  be safely used in subprograms, since they return error codes
  4912.      rather  than  using error trapping (subprograms have severe limitations
  4913.      on  use  of  error  trapping).   They  provide access to the file-level
  4914.      locking  capabilities  of  DOS  2.0 and above, which allows creation of
  4915.      programs  which  work  on normal computers as well as those with multi-
  4916.      tasking  or  networking  (BASIC's  record-level locking is incompatible
  4917.      with normal computers unless SHARE is activated).
  4918.  
  4919.           In  BASIC,  you give the file a number when you open it, and refer
  4920.      to  the  file  by that number from then on.  With the ADVBAS functions,
  4921.      you  are  given  a  "handle"  when  you open the file, which serves the
  4922.      same  purpose.  In BASIC, a file is automatically created (or truncated
  4923.      if  it  exists)  if  you open it for output.  With ADVBAS, you must use
  4924.      FCREATE  to  produce  that  result.  If you have an existing file which
  4925.      you  want  to  modify  (or  read), use FOPEN.  With ADVBAS, like BASIC,
  4926.      you  can  read  or write to a file, or move the file pointer to a given
  4927.      record or to the end of file (to append information).  Also like BASIC,
  4928.      you must close a file when you are finished using it.
  4929.  
  4930.      The error codes returned by these functions are as follows:
  4931.        -1    Unable to read or write the entire record
  4932.         2    File not found
  4933.         3    Path not found
  4934.         4    No handle available
  4935.         5    Access denied
  4936.         6    Invalid handle
  4937.        15    Invalid drive specification
  4938.  
  4939.           If  you  get  "no  handle  available", you have run out of room to
  4940.      open  files.   You  can  fix  this  by not opening so many files at the
  4941.      same  time, or by increasing the FILES=xx statement in your CONFIG.SYS.
  4942.      See your DOS manual for further information.
  4943.  
  4944.  
  4945.  
  4946.  
  4947.  
  4948.  
  4949.  
  4950.  
  4951.  
  4952.  
  4953.  
  4954.  
  4955.  
  4956.  
  4957.  
  4958.  
  4959.  
  4960.  
  4961.  
  4962.  
  4963.  
  4964.  
  4965.  
  4966.  
  4967.                                    BASCOM Bugs
  4968.  
  4969.  
  4970.  
  4971.      Microsoft QuickBASIC Compiler v1.00:
  4972.  
  4973.           If  there  is  not enough memory when you try to execute the SHELL
  4974.      command, your program will crash.
  4975.           The  error  STRING FORMULA TOO COMPLEX appears erratically in some
  4976.      programs, for no apparently good reason.
  4977.  
  4978.  
  4979.      Microsoft QuickBASIC Compiler v1.02:
  4980.  
  4981.           This  release  solves the SHELL crash problem.  Also, more control
  4982.      characters  are  now  printed out just like BASICA.  Many miscellaneous
  4983.      problems  have  been  fixed... but  not the infamous STRING FORMULA TOO
  4984.      COMPLEX error.
  4985.  
  4986.  
  4987.  
  4988.  
  4989.  
  4990.  
  4991.  
  4992.  
  4993.  
  4994.  
  4995.  
  4996.  
  4997.  
  4998.  
  4999.  
  5000.  
  5001.  
  5002.  
  5003.  
  5004.  
  5005.  
  5006.  
  5007.  
  5008.  
  5009.  
  5010.  
  5011.  
  5012.  
  5013.  
  5014.  
  5015.  
  5016.  
  5017.  
  5018.  
  5019.  
  5020.  
  5021.  
  5022.  
  5023.  
  5024.  
  5025.  
  5026.  
  5027.  
  5028.  
  5029.  
  5030.  
  5031.  
  5032.  
  5033.                                    BASCOM Bugs
  5034.  
  5035.  
  5036.  
  5037.      Microsoft QuickBASIC Compiler v2.00:
  5038.  
  5039.           This  release  fixes  yet  more compiler bugs.  The STRING FORMULA
  5040.      TOO  COMPLEX  error  lives on, however.  A few minor new functions have
  5041.      been  added.   The  new  programming environment is poorly designed for
  5042.      something  which  is  evidently  supposed to mimic the "intuitive" feel
  5043.      of  the  MacIntosh  (later note: it works fairly sensibly with a mouse,
  5044.      just  not  with  the keyboard).  The editor is nonstandard, inadequate,
  5045.      and  suffers  from  a number of irritating bugs.  The new "user library
  5046.      feature"  is  a  nuisance-- it is incompatible with standard libraries,
  5047.      and  is  poor  from  a  developer's standpoint because you are required
  5048.      to  list  all  the  names  of all the subprograms in a library whenever
  5049.      you modify the library.
  5050.           The  one  thing  that  is really good about the new version of the
  5051.      compiler  is  the  manual,  which  is quite excellent-- enormous, clear
  5052.      and detailed.
  5053.  
  5054.      ANNOYANCES:
  5055.           The  editor  has  a  defective  search-and-replace  function, adds
  5056.      blank  lines  at  the  end of the program under certain conditions, and
  5057.      allows  you  to  put  some control characters directly into the program
  5058.      (which gives the compiler indigestion).
  5059.           When  entering  the  filename,  you  have  to  use Shift-Backspace
  5060.      instead of the Delete key to delete characters.  The use of TAB, SPACE,
  5061.      RETURN,  and the arrow keys when making a choice on the menus is arbit-
  5062.      rary,  weird, and counterintuitive in the extreme (later note: it works
  5063.      better  if  you  use a mouse).  If you use the old method of compiling,
  5064.      bypassing  the  new  environment, you no longer get any error messages,
  5065.      just an error count.  You can't get a source listing any more, either.
  5066.  
  5067.      BUGS:
  5068.           If  your  program  uses  error trapping, it must have at least one
  5069.      line  number in the program, even you normally only use labels.  Other-
  5070.      wise the program will crash if it runs into an error.
  5071.           Screen paging doesn't work.
  5072.           If  you have a REMark on the same line as a DATA statement, you'll
  5073.      get peculiar error messages.
  5074.           And many more (see notes on v2.01!).
  5075.  
  5076.  
  5077.      Microsoft QuickBASIC v2.01:
  5078.  
  5079.           This  is  an  update  to v2.00, which is being distributed free of
  5080.      charge  to registered owners of QB 2.00.  It consists entirely of fixes
  5081.      to  an  amazing  number  of bugs in the v2.00 compiler, and corrections
  5082.      to  errors  in  the  manual.  Get this by all means!  This version also
  5083.      restores error listings to the command-line method of compiling.
  5084.  
  5085.  
  5086.  
  5087.  
  5088.  
  5089.  
  5090.  
  5091.  
  5092.  
  5093.  
  5094.  
  5095.  
  5096.  
  5097.  
  5098.  
  5099.      Wish list for Microsoft's QuickBASIC:
  5100.  
  5101.           Recursive functions and procedures ("subprograms").
  5102.           Production of code which can be linked with other languages.
  5103.           Less  outrageously  massive  overhead  for  producing  stand-alone
  5104.      programs.
  5105.           An  error  trapping function that returns the label of the routine
  5106.      where the error took place (like ERL, only for labels).
  5107.           Communications  functions  which  don't  produce  errors  whenever
  5108.      you get the slightest bit of line noise.
  5109.  
  5110.  
  5111.      Notes on Borland's Turbo BASIC v1.0:
  5112.  
  5113.           Turbo  BASIC  is almost completely compatible with BASICA/GWBASIC,
  5114.      and  fairly  compatible  with  QuickBASIC.  It supports recursive func-
  5115.      tions,  local  variables, long integers, and the 8087 chip, among other
  5116.      things.   It  has  a  fairly  slick  windowing programming environment,
  5117.      and features online, context-sensitive help.  The editor is a configur-
  5118.      able  Wordstar-type  editor.   Code  size  and speed seem to be roughly
  5119.      comparable  to  QuickBASIC  (better or worse depending on the program).
  5120.      Turbo BASIC's main fault seems to be that it lacks an assembly language
  5121.      interface--  it  uses  a  machine-language  INLINE  format like that in
  5122.      Turbo  Pascal.  This is going to make it an extreme nuisance to convert
  5123.      ADVBAS  for  use  with Turbo BASIC, but such is life.  In general, this
  5124.      is  at  least  as  strong  a  product as Microsoft's QuickBASIC, and it
  5125.      looks like we're shaping up for some fine marketing battles.
  5126.  
  5127.  
  5128.      Notes on Microsoft QuickBASIC v3.0, due out around April '87:
  5129.  
  5130.           The  major change here appears to be the addition of 8087 support,
  5131.      and  possibly  EGA  support  (although  they've  claimed EGA support as
  5132.      of  v2.0,  for  no  obvious  reason).   I haven't been able to find out
  5133.      anything further about this 'un.
  5134.  
  5135.  
  5136.  
  5137.  
  5138.  
  5139.  
  5140.  
  5141.  
  5142.  
  5143.  
  5144.  
  5145.  
  5146.  
  5147.  
  5148.  
  5149.  
  5150.  
  5151.  
  5152.  
  5153.  
  5154.  
  5155.  
  5156.  
  5157.  
  5158.  
  5159.  
  5160.  
  5161.  
  5162.  
  5163.  
  5164.  
  5165.                                    BASIC Bugs
  5166.  
  5167.  
  5168.  
  5169.  
  5170.           This  is  a  peculiar  one... it seems that BASIC can create files
  5171.      having  names  which  contain blank spaces.  This is a problem, because
  5172.      DOS  considers  the  space  to  be  a delimiter, and thus cannot handle
  5173.      these files.  Such files will not be listed correctly in the directory,
  5174.      and  will  be  impossible  to  manipulate from DOS (can't read, delete,
  5175.      or  otherwise  handle  the  file).  So, be careful to screen out spaces
  5176.      when  creating files from BASIC!  This caveat also applies to subdirec-
  5177.      tories, including those created with the MAKESUB routine of ADVBAS.
  5178.  
  5179.  
  5180.  
  5181.      Call for help:
  5182.  
  5183.           If  you  find  any other bugs in any IBM/Microsoft BASIC compiler,
  5184.      or  in  ADVBAS  for  that  matter,  please let me know.  If I can't fix
  5185.      it, at least I can warn people!
  5186.  
  5187.  
  5188.  
  5189.  
  5190.  
  5191.  
  5192.  
  5193.  
  5194.  
  5195.  
  5196.  
  5197.  
  5198.  
  5199.  
  5200.  
  5201.  
  5202.  
  5203.  
  5204.  
  5205.  
  5206.  
  5207.  
  5208.  
  5209.  
  5210.  
  5211.  
  5212.  
  5213.  
  5214.  
  5215.  
  5216.  
  5217.  
  5218.  
  5219.  
  5220.  
  5221.  
  5222.  
  5223.  
  5224.  
  5225.